Mercurial > repos > yating-l > snap
changeset 21:211c9b3a5c15 draft
planemo upload commit 6e3286c6569d531846474dcd6959378af0317ce3-dirty
author | yating-l |
---|---|
date | Fri, 12 Aug 2016 18:26:59 -0400 |
parents | 04e57f9ef873 |
children | ab843488e9ea |
files | Group.pyc error.txt gff2Togff3.py out snap.xml test.txt |
diffstat | 6 files changed, 59 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/error.txt Fri Aug 12 18:26:59 2016 -0400 @@ -0,0 +1,2 @@ +scoring.....decoding.10.20.30.40.50.60.70.80.90.100 done +scoring.....decoding.10.20.30.40.50.60.70.80.90.100 done
--- a/gff2Togff3.py Fri Aug 12 15:01:58 2016 -0400 +++ b/gff2Togff3.py Fri Aug 12 18:26:59 2016 -0400 @@ -1,10 +1,28 @@ - +import argparse +import sys +import fileinput from Group import Group -class Convertor: +def main(): + parser = argparse.ArgumentParser(description='Get a gff file and the output gff3 file') + parser.add_argument('--input', help='input gff file') + parser.add_argument('--output', help='output gff3 file', required=True) + args = parser.parse_args() + input = args.input + output = args.output + if not sys.stdin.isatty(): + c = Convertor(sys.stdin, output) + else: + c = Convertor(input, output) + c.convert() + +class Convertor: def __init__(self, input, output): - with open(input) as self.f: - self.li = [line.rstrip().split("\t") for line in self.f] + if type(input) is str: + with open(input) as self.f: + self.li = [line.rstrip().split("\t") for line in self.f] + else: + self.li = [line.rstrip().split("\t") for line in input] self.gff3 = open(output, "w") self.gff3.write("##gff-version 3\n") @@ -35,8 +53,7 @@ if __name__ == "__main__": - file = Convertor("dbia3.gff", "test.txt") - file.convert() + main() \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/out Fri Aug 12 18:26:59 2016 -0400 @@ -0,0 +1,2 @@ +scoring.....decoding.10.20.30.40.50.60.70.80.90.100 done +scoring.....decoding.10.20.30.40.50.60.70.80.90.100 done
--- a/snap.xml Fri Aug 12 15:01:58 2016 -0400 +++ b/snap.xml Fri Aug 12 18:26:59 2016 -0400 @@ -20,11 +20,10 @@ $transcripts "$output3" #end if -gff + -quiet $organism - from gff2Togff3 import Convertor - f = Convertor("$output1", "$output4") - f.convert() - "$input1" > "$output4" + $input1 + | python $__tool_directory__/gff2Togff3.py --output $output1 ]]></command> <inputs> <param type="data" name="input1" format="dna.gz" /> @@ -89,7 +88,7 @@ </conditional> </inputs> <outputs> - <data name="output1" format="gff" label="${tool.name} on ${on_string}: GTF/GFF"> + <data name="output1" format="gff3" label="${tool.name} on ${on_string}: GTF/GFF3"> </data> <data name="output2" format="fasta" label="${tool.name} on ${on_string}: Protein sequence"> <filter>proteins == "-aa"</filter> @@ -102,8 +101,7 @@ <test> <param name="input1" value="thale.dna.gz"/> <param name="organism" value="At.hmm" /> - <param name="format" value="-gff" /> - <output name="output1" file="thale.gff"/> + <output name="output1" file="thale.gff3"/> </test> </tests> <help><![CDATA[
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test.txt Fri Aug 12 18:26:59 2016 -0400 @@ -0,0 +1,27 @@ +##gff-version 3 +At1g01040.0 SNAP gene 1007 5917 . + . ID=At1g01040.0-snap.1 +At1g01040.0 SNAP mRNA 1007 5917 . + . ID=mRNA_At1g01040.0-snap.1;Parent=At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 1007 1954 85.269 + 0 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 2024 2137 8.926 + 0 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 2234 2444 20.788 + 0 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 2523 2917 35.162 + 2 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 3006 3225 34.428 + 0 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 3307 3479 14.790 + 2 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 3563 3685 4.678 + 0 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 3774 3934 10.179 + 0 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 4025 4258 25.991 + 1 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 4344 4506 4.289 + 1 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 4581 4763 28.696 + 0 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 4854 5015 15.217 + 0 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 5100 5195 23.205 + 0 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP CDS 5285 5917 45.878 + 0 Parent=mRNA_At1g01040.0-snap.1 +At1g01040.0 SNAP gene 6086 8561 . + . ID=At1g01040.0-snap.2 +At1g01040.0 SNAP mRNA 6086 8561 . + . ID=mRNA_At1g01040.0-snap.2;Parent=At1g01040.0-snap.2 +At1g01040.0 SNAP CDS 6086 6144 6.596 + 0 Parent=mRNA_At1g01040.0-snap.2 +At1g01040.0 SNAP CDS 6190 6287 22.495 + 1 Parent=mRNA_At1g01040.0-snap.2 +At1g01040.0 SNAP CDS 6372 6562 17.809 + 2 Parent=mRNA_At1g01040.0-snap.2 +At1g01040.0 SNAP CDS 6642 6803 16.407 + 0 Parent=mRNA_At1g01040.0-snap.2 +At1g01040.0 SNAP CDS 6828 7547 69.159 + 0 Parent=mRNA_At1g01040.0-snap.2 +At1g01040.0 SNAP CDS 7629 7793 40.262 + 0 Parent=mRNA_At1g01040.0-snap.2 +At1g01040.0 SNAP CDS 7892 8298 46.310 + 0 Parent=mRNA_At1g01040.0-snap.2 +At1g01040.0 SNAP CDS 8384 8561 17.079 + 1 Parent=mRNA_At1g01040.0-snap.2