1
|
1
|
|
2 def listfiles(unpaired_samples,paired_samples):
|
|
3 file_list = []
|
|
4
|
|
5 if(unpaired_samples != None):
|
|
6 if(type(unpaired_samples) == type([])):
|
|
7 for sample in unpaired_samples:
|
|
8 file_list.append([sample.name,sample.file_name,False])
|
|
9
|
|
10 ## The following takes care of a bug in galaxy;
|
|
11 ## if only one history object is selected, it isn't returned as a list but as single object.
|
|
12 ## This is probably a rudimentair part of code that originates from the time that multiple data-objects were not implemented.
|
|
13
|
|
14 else:
|
|
15 file_list.append([unpaired_samples.name,unpaired_samples.file_name,False])
|
|
16
|
|
17 if(paired_samples != None):
|
|
18 pair_id = 0
|
|
19 for pair in paired_samples:
|
|
20 pair_id += 1
|
|
21 sample_id = 0
|
|
22 for sample in pair['samples']:
|
|
23 sample_id += 1
|
|
24 file_list.append([sample['sample'].name+" *[Pair "+str(pair_id)+"; sample "+str(sample_id)+"]",sample['sample'].file_name,False])
|
|
25
|
|
26 return file_list
|