Mercurial > repos > florianbegusch > qiime2_suite
comparison qiime2/qiime_tools_import.xml @ 14:a0a8d77a991c draft
Uploaded
author | florianbegusch |
---|---|
date | Thu, 03 Sep 2020 09:51:29 +0000 |
parents | f190567fe3f6 |
children |
comparison
equal
deleted
inserted
replaced
13:887cd4ad8e16 | 14:a0a8d77a991c |
---|---|
17 #set $semantic_type = $type_temp | 17 #set $semantic_type = $type_temp |
18 #end if | 18 #end if |
19 | 19 |
20 #def is_fastq($f_test) | 20 #def is_fastq($f_test) |
21 #set $f = open($f_test, 'rb') | 21 #set $f = open($f_test, 'rb') |
22 #set $fastq = str($f.readline()[0]) | |
22 #if str($f.readline()[0]) == '@' | 23 #if str($f.readline()[0]) == '@' |
23 #$f.close() | 24 #$f.close() |
24 #return True | 25 #return True |
25 #end if | 26 #end if |
26 | 27 |
27 #$f.close() | 28 #$f.close() |
28 #return False | 29 #return $fastq |
29 #end def | 30 #end def |
30 | 31 |
31 | 32 |
32 ## Symlinks creation or On the fly creation of a combo file | 33 ## Symlinks creation or On the fly creation of a combo file |
33 #if $input_type.type == 'list_list' | 34 #if $input_type.type == 'list_list' |
34 ## Symlinks creation or On the fly creation of a combo file | 35 ## Symlinks creation or On the fly creation of a combo file |
35 #for $f in $input_type.list_list: | 36 #for $f in $input_type.list_list: |
36 | 37 |
37 #set $is_fastq_file = $is_fastq(str($f)) | 38 #set $is_fastq_file = $is_fastq(str($f)) |
38 | 39 |
39 #if $is_fastq_file: | 40 #if $is_fastq_file: |
40 #set $file_for_processing = "'input/" + $f.name + '.gz' + "'" | 41 #set $file_for_processing = "'input/" + $f.name + '.gz' + "'" |
41 gzip -c ${f} > $file_for_processing; | 42 gzip -c ${f} > $file_for_processing; |
43 ##echo $is_fastq_file; | |
42 #else | 44 #else |
43 #set $file_for_processing = "'input/" + $f.name + "'" | 45 #set $file_for_processing = "'input/" + $f.name + "'" |
44 ln -s ${f} $file_for_processing; | 46 ln -s ${f} $file_for_processing; |
47 ##echo $is_fastq_file; | |
45 #end if | 48 #end if |
46 #end for | 49 #end for |
47 #if 'SingleEndFastqManifestPhred' in str($inputformat): | 50 #if 'SingleEndFastqManifestPhred' in str($inputformat): |
48 #set $cwd = str($outputpath.extra_files_path) + "_manifest_file.txt" | 51 #set $cwf = str($outputpath.extra_files_path) + "_manifest_file.txt" |
49 #set $m_file = open(str($cwd), 'w') | 52 #set $tt = str("sample-id,absolute-filepath,direction") |
50 $m_file.write("sample-id,absolute-filepath,direction\n") | 53 echo $tt >> $cwf; |
51 #for $f in $input_type.list_list: | 54 #for $f in $input_type.list_list: |
52 $m_file.write(str($f.name).split("_")[0]+",$PWD/input/"+str($f.name)+".gz,forward\n") | 55 #set $tt = str($f.name).split("_")[0]+",$PWD/input/"+str($f.name).split(".")[0]+".fastq.gz,forward\n" |
56 echo $tt >> $cwf; | |
53 #end for | 57 #end for |
54 $m_file.close() | 58 |
55 #set $in_= str($cwd) | 59 #set $in_= str($cwf) |
56 #end if | 60 #end if |
57 | 61 |
58 | 62 |
59 #elif $input_type.type == 'list_paired_collection': | 63 #elif $input_type.type == 'list_paired_collection': |
60 | 64 |
61 #set $cwd = str($outputpath.extra_files_path) + "_manifest_file.txt" | 65 #set $cwf = str($outputpath.extra_files_path) + "_manifest_file.txt" |
62 #set $m_file = open(str($cwd), 'w') | 66 #set $tt = str("sample-id,absolute-filepath,direction") |
63 $m_file.write("sample-id,absolute-filepath,direction\n") | 67 echo $tt >> $cwf; |
64 | 68 |
65 #for $pair in $input_type.list_paired_collection: | 69 #for $pair in $input_type.list_paired_collection: |
66 #set $forward_is_fastq_file = $is_fastq(str($pair.forward)) | 70 #set $forward_is_fastq_file = $is_fastq(str($pair.forward)) |
67 #set $reverse_is_fastq_file = $is_fastq(str($pair.reverse)) | 71 #set $reverse_is_fastq_file = $is_fastq(str($pair.reverse)) |
68 | 72 |
69 #if $forward_is_fastq_file: | 73 #if $forward_is_fastq_file: |
70 gzip -c ${pair.forward} > input/${pair.name}_R1_001.fastq.gz; | 74 gzip -c ${pair.forward} > input/${pair.name}_R1_001.fastq.gz; |
71 $m_file.write(str($pair.name).split("_")[0]+",$PWD/input/"+str($pair.name)+"_R1_001.fastq.gz,forward\n") | 75 #set $tt = str($pair.name).split("_")[0]+",$PWD/input/"+str($pair.name)+"_R1_001.fastq.gz,forward\n" |
76 echo $tt >> $cwf; | |
72 #else | 77 #else |
73 ln -s ${pair.forward} input/${pair.name}_R1_001.fastq.gz; | 78 ln -s ${pair.forward} input/${pair.name}_R1_001.fastq.gz; |
74 $m_file.write(str($pair.name).split("_")[0]+",$PWD/input/"+str($pair.name)+"_R1_001.fastq.gz,forward\n") | 79 #set $tt = str($pair.name).split("_")[0]+",$PWD/input/"+str($pair.name)+"_R1_001.fastq.gz,forward\n" |
80 echo $tt >> $cwf; | |
75 #end if | 81 #end if |
76 | 82 |
77 #if $reverse_is_fastq_file: | 83 #if $reverse_is_fastq_file: |
78 gzip -c ${pair.reverse} > input/${pair.name}_R2_001.fastq.gz; | 84 gzip -c ${pair.reverse} > input/${pair.name}_R2_001.fastq.gz; |
79 $m_file.write(str($pair.name).split("_")[0]+",$PWD/input/"+str($pair.name)+"_R2_001.fastq.gz,reverse\n") | 85 #set $tt = str($pair.name).split("_")[0]+",$PWD/input/"+str($pair.name)+"_R2_001.fastq.gz,reverse\n" |
86 echo $tt >> $cwf; | |
80 #else | 87 #else |
81 ln -s ${pair.reverse} input/${pair.name}_R2_001.fastq.gz; | 88 ln -s ${pair.reverse} input/${pair.name}_R2_001.fastq.gz; |
82 $m_file.write(str($pair.name).split("_")[0]+",$PWD/input/"+str($pair.name)+"_R2_001.fastq.gz,reverse\n") | 89 #set $tt = str($pair.name).split("_")[0]+",$PWD/input/"+str($pair.name)+"_R2_001.fastq.gz,reverse\n" |
90 echo $tt >> $cwf; | |
83 #end if | 91 #end if |
84 #end for | 92 #end for |
85 | 93 |
86 | 94 |
87 $m_file.close() | 95 |
88 #if 'PairedEndFastqManifestPhred' in str($inputformat): | 96 #if 'PairedEndFastqManifestPhred' in str($inputformat) or 'SingleEndFastqManifestPhred33V2' in str($inputformat) or 'SingleEndFastqManifestPhred33' in str($inputformat): |
89 #set $in_= str($cwd) | 97 |
98 #set $in_= str($cwf) | |
99 | |
90 #elif 'Casava' in str($inputformat): | 100 #elif 'Casava' in str($inputformat): |
91 #set $in_= 'input' | 101 #set $in_= 'input' |
92 #end if | 102 #end if |
93 | 103 |
104 | |
94 #else | 105 #else |
95 #set $res = $is_fastq(str($file)) | 106 #set $res = $is_fastq(str($file)) |
96 | 107 |
97 #if $res | 108 #if $res |
98 gzip -c ${file} > ${file.name}.gz; | 109 gzip -c ${file} > ${file.name}.gz; |
266 </param> | 277 </param> |
267 </inputs> | 278 </inputs> |
268 <outputs> | 279 <outputs> |
269 <data format="qza" label="${tool.name} on ${on_string}: outputpath.qza" name="outputpath"/> | 280 <data format="qza" label="${tool.name} on ${on_string}: outputpath.qza" name="outputpath"/> |
270 </outputs> | 281 </outputs> |
271 <stdio> | 282 <!--<stdio> |
272 <exit_code range="2" level="warning" description="Error" /> | 283 <exit_code range="2" level="warning" description="Error" /> |
273 </stdio> | 284 </stdio>--> |
274 <help> | 285 <help> |
275 </help> | 286 </help> |
276 <macros> | 287 <macros> |
277 <import>qiime_citation.xml</import> | 288 <import>qiime_citation.xml</import> |
278 </macros> | 289 </macros> |