comparison cuffcompare_wrapper.py @ 6:8e534225baa9 draft

Uploaded
author devteam
date Fri, 19 Dec 2014 11:55:55 -0500
parents 8b22e9adae34
children 1322b73ffe44
comparison
equal deleted inserted replaced
5:67695d7ff787 6:8e534225baa9
10 10
11 def __main__(): 11 def __main__():
12 #Parse Command Line 12 #Parse Command Line
13 parser = optparse.OptionParser() 13 parser = optparse.OptionParser()
14 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.' ) 14 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.' )
15 parser.add_option( '-R', action="store_true", dest='ignore_nonoverlap', 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' ) 15 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' )
16 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!)' )
17
16 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.') 18 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.')
17 19
20 parser.add_option( '-M', action="store_true", dest='discard_single_exon_all', help='discard (ignore) single-exon transfrags and reference transcript')
21 parser.add_option( '-N', action="store_true", dest='discard_single_exon_ref', help='discard (ignore) single-exon reference transcripts')
22 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')
23 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')
24 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)')
25
18 # Wrapper / Galaxy options. 26 # Wrapper / Galaxy options.
19 parser.add_option( '', '--index', dest='index', help='The path of the reference genome' ) 27 parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
20 parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' ) 28 parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
21 29
22 # Outputs. 30 # Outputs.
61 cmd = "cuffcompare -o cc_output " 69 cmd = "cuffcompare -o cc_output "
62 70
63 # Add options. 71 # Add options.
64 if options.ref_annotation: 72 if options.ref_annotation:
65 cmd += " -r %s " % options.ref_annotation 73 cmd += " -r %s " % options.ref_annotation
66 if options.ignore_nonoverlap: 74 if options.ignore_nonoverlap_reference:
67 cmd += " -R " 75 cmd += " -R "
76 if options.ignore_nonoverlap_transfrag:
77 cmd += " -Q "
68 if options.use_seq_data: 78 if options.use_seq_data:
69 cmd += " -s %s " % seq_path 79 cmd += " -s %s " % seq_path
70 80 if options.discard_single_exon_all:
81 cmd += " -M "
82 if options.discard_single_exon_ref:
83 cmd += " -N "
84 if options.max_dist_exon:
85 cmd += " -e %i " % int( options.max_dist_exon )
86 if options.max_dist_group:
87 cmd += " -d %i " % int( options.max_dist_group )
88 if options.discard_redundant_intron_transfrags:
89 cmd += " -F "
71 # Add input files. 90 # Add input files.
72 91
73 # Need to symlink inputs so that output files are written to temp directory. 92 # Need to symlink inputs so that output files are written to temp directory.
74 for i, arg in enumerate( args ): 93 for i, arg in enumerate( args ):
75 input_file_name = "./input%i" % ( i+1 ) 94 input_file_name = "./input%i" % ( i+1 )