annotate cuffcompare_wrapper.py @ 9:e66b9b5b8580 draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit 82ee6fc860c52c531b7a57bbb346ab1a67a434a5
author devteam
date Sun, 19 Feb 2017 12:12:05 -0500
parents 1322b73ffe44
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
1 #!/usr/bin/env python
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
2
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
3 # Supports Cuffcompare versions v1.3.0 and newer.
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
4
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
5 import optparse
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
6 import os
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
7 import shutil
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
8 import subprocess
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
9 import sys
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
10 import tempfile
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
11
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
12
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
13 def stop_err(msg):
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
14 sys.stderr.write('%s\n' % msg)
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
15 sys.exit()
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
16
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
17
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
18 def __main__():
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
19 parser = optparse.OptionParser()
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
20 parser.add_option('-r', dest='ref_annotation', help='An optional "reference" annotation GTF. Each sample is matched against this file, and sample isoforms are tagged as overlapping, matching, or novel where appropriate. See the refmap and tmap output file descriptions below.')
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
21 parser.add_option('-R', action="store_true", dest='ignore_nonoverlap_reference', help='If -r was specified, this option causes cuffcompare to ignore reference transcripts that are not overlapped by any transcript in one of cuff1.gtf,...,cuffN.gtf. Useful for ignoring annotated transcripts that are not present in your RNA-Seq samples and thus adjusting the "sensitivity" calculation in the accuracy report written in the transcripts accuracy file')
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
22 parser.add_option('-Q', action="store_true", dest='ignore_nonoverlap_transfrag', help='If -r was specified, this option causes cuffcompare to consider only the input transcripts that overlap any of the reference transcripts (Sp correction); Warning: this will discard all "novel" loci!)')
6
8e534225baa9 Uploaded
devteam
parents: 2
diff changeset
23
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
24 parser.add_option('-s', dest='use_seq_data', action="store_true", help='Causes cuffcompare to look into for fasta files with the underlying genomic sequences (one file per contig) against which your reads were aligned for some optional classification functions. For example, Cufflinks transcripts consisting mostly of lower-case bases are classified as repeats. Note that <seq_dir> must contain one fasta file per reference chromosome, and each file must be named after the chromosome, and have a .fa or .fasta extension.')
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
25
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
26 parser.add_option('-M', action="store_true", dest='discard_single_exon_all', help='discard (ignore) single-exon transfrags and reference transcript')
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
27 parser.add_option('-N', action="store_true", dest='discard_single_exon_ref', help='discard (ignore) single-exon reference transcripts')
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
28 parser.add_option('-e', dest='max_dist_exon', help='Max. Distance for assessing exon accuracy" help="max. distance (range) allowed from free ends of terminal exons of reference transcripts when assessing exon accuracy. Default: 100')
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
29 parser.add_option('-d', dest='max_dist_group', help='Max.Distance for transcript grouping" help="max. distance (range) for grouping transcript start sites. Default: 100')
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
30 parser.add_option('-F', action="store_true", dest='discard_redundant_intron_transfrags', help='Discard intron-redundant transfrags if they share the 5-prime end (if they differ only at the 3-prime end)')
6
8e534225baa9 Uploaded
devteam
parents: 2
diff changeset
31
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
32 # Wrapper / Galaxy options.
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
33 parser.add_option('', '--index', dest='index', help='The path of the reference genome')
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
34 parser.add_option('', '--ref_file', dest='ref_file', help='The reference dataset from the history')
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
35
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
36 # Outputs.
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
37 parser.add_option('', '--combined-transcripts', dest='combined_transcripts')
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
38
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
39 (options, args) = parser.parse_args()
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
40
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
41 # Set/link to sequence file.
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
42 if options.use_seq_data:
2
8b22e9adae34 Update to the new data table specification.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
43 if options.ref_file:
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
44 # Sequence data from history.
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
45 # Create symbolic link to ref_file so that index will be created in working directory.
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
46 seq_path = "ref.fa"
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
47 os.symlink(options.ref_file, seq_path)
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
48 else:
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
49 if not os.path.exists(options.index):
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
50 stop_err('Reference genome %s not present, request it by reporting this error.' % options.index)
2
8b22e9adae34 Update to the new data table specification.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
51 seq_path = options.index
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
52
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
53 # Build command.
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
54
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
55 # Base.
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
56 cmd = "cuffcompare -o cc_output "
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
57
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
58 # Add options.
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
59 if options.ref_annotation:
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
60 cmd += " -r %s " % options.ref_annotation
6
8e534225baa9 Uploaded
devteam
parents: 2
diff changeset
61 if options.ignore_nonoverlap_reference:
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
62 cmd += " -R "
6
8e534225baa9 Uploaded
devteam
parents: 2
diff changeset
63 if options.ignore_nonoverlap_transfrag:
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
64 cmd += " -Q "
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
65 if options.use_seq_data:
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
66 cmd += " -s %s " % seq_path
6
8e534225baa9 Uploaded
devteam
parents: 2
diff changeset
67 if options.discard_single_exon_all:
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
68 cmd += " -M "
6
8e534225baa9 Uploaded
devteam
parents: 2
diff changeset
69 if options.discard_single_exon_ref:
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
70 cmd += " -N "
6
8e534225baa9 Uploaded
devteam
parents: 2
diff changeset
71 if options.max_dist_exon:
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
72 cmd += " -e %i " % int(options.max_dist_exon)
6
8e534225baa9 Uploaded
devteam
parents: 2
diff changeset
73 if options.max_dist_group:
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
74 cmd += " -d %i " % int(options.max_dist_group)
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
75 if options.discard_redundant_intron_transfrags:
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
76 cmd += " -F "
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
77 # Add input files.
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
78
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
79 # Need to symlink inputs so that output files are written to the current directory.
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
80 for i, arg in enumerate(args):
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
81 input_file_name = "./input%i" % (i + 1)
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
82 os.symlink(arg, input_file_name)
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
83 cmd += "%s " % input_file_name
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
84
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
85 # Run command.
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
86 try:
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
87 with tempfile.NamedTemporaryFile(dir=".") as tmp_stderr:
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
88 returncode = subprocess.call(args=cmd, stderr=tmp_stderr, shell=True)
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
89
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
90 # Error checking.
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
91 if returncode != 0:
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
92 # Get stderr, allowing for case where it's very large.
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
93 buffsize = 1048576
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
94 stderr = ''
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
95 with open(tmp_stderr.name) as tmp_stderr2:
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
96 try:
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
97 while True:
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
98 stderr += tmp_stderr2.read(buffsize)
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
99 if not stderr or len(stderr) % buffsize != 0:
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
100 break
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
101 except OverflowError:
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
102 pass
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
103 raise Exception(stderr)
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
104
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
105 # Copy outputs.
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
106 shutil.move("cc_output.combined.gtf", options.combined_transcripts)
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
107
0
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
108 # check that there are results in the output file
9d35cf35634e Uploaded tool tarball.
devteam
parents:
diff changeset
109 cc_output_fname = "cc_output.stats"
8
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
110 if len(open(cc_output_fname).read().strip()) == 0:
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
111 raise Exception('The main output file is empty, there may be an error with your input file or settings.')
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
112 except Exception as e:
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
113 stop_err('Error running cuffcompare: %s' % e)
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
114
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
115
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
116 if __name__ == "__main__":
1322b73ffe44 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/cufflinks/cuffcompare commit eb18f691975ef9539b5ebd4f118343c8ad967a1f
devteam
parents: 6
diff changeset
117 __main__()