changeset 14:344bacf6acb8 draft

Uploaded
author rlegendre
date Fri, 10 Apr 2015 03:18:56 -0400
parents 7c944fd9907e
children 702e60e819c2
files get_codon_frequency.py get_codon_frequency.xml metagene_frameshift_analysis.py metagene_frameshift_analysis.xml metagene_readthrough.py
diffstat 5 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/get_codon_frequency.py	Thu Apr 09 11:35:48 2015 -0400
+++ b/get_codon_frequency.py	Fri Apr 10 03:18:56 2015 -0400
@@ -94,7 +94,7 @@
                         continue
                     len_read = len(read.split('\t')[9])        
                     # if it's read of good length
-                    if len_read == kmer and (tag in line or multi_tag not in line):
+                    if len_read == kmer and (tag in read or multi_tag not in read):
                         feat = read.split('\t')
                         seq = feat[9]
                         # if it's a reverse read
--- a/get_codon_frequency.xml	Thu Apr 09 11:35:48 2015 -0400
+++ b/get_codon_frequency.xml	Fri Apr 10 03:18:56 2015 -0400
@@ -59,8 +59,8 @@
 		<param name="kmer" type="integer" label="Lenght of the best phasing footprints" value ="28"  />
 		<param name="cond1" type="text" size="25" label="Condition one" help="Required even if no replicate" value="cond1"/>
 		<param name="cond2" type="text" size="25" label="Condition two" help="Required even if no replicate" value="cond2"/>
-		<param name="color1" type="text" size="50" label="Color for first condition" value ="SkyBlue" help="Enter standard name, hex color string, or rgb code. You cand find all colors here : http://pythonhosted.org/ete2/reference/reference_svgcolors.html" />
-		<param name="color2" type="text" size="50" label="Color for second condition" value ="Plum" help="Enter standard name, hex color string, or rgb code. You cand find all colors here : http://pythonhosted.org/ete2/reference/reference_svgcolors.html" />
+		<param name="color1" type="text" size="50" label="Color for first condition" value ="SkyBlue" help="Enter standard name, hex color string, or rgb code. You can find all colors here : http://pythonhosted.org/ete2/reference/reference_svgcolors.html" />
+		<param name="color2" type="text" size="50" label="Color for second condition" value ="Plum" help="Enter standard name, hex color string, or rgb code. You can find all colors here : http://pythonhosted.org/ete2/reference/reference_svgcolors.html" />
 					
 	</inputs>
 
--- a/metagene_frameshift_analysis.py	Thu Apr 09 11:35:48 2015 -0400
+++ b/metagene_frameshift_analysis.py	Fri Apr 10 03:18:56 2015 -0400
@@ -75,7 +75,7 @@
                 # calculate number of reads 
                 n += reads.count(chrm)
 
-        sys.stdout.write("%d reads are presents in your bam file\n" % n)
+        sys.stdout.write("%d reads are present in your bam file\n" % n)
     
     except Exception, e:
         stop_err( 'Error during bam file splitting : ' + str( e ) )
@@ -313,7 +313,7 @@
            
         whole_phasing = __percent__(whole_phasing)
         sys.stdout.write("Proportion of reads in each frame :\n%s\n" % whole_phasing)
-        sys.stdout.write("Mean length of ORF in your organisme : %s\n" % int(mean_orf/nb_gene))
+        sys.stdout.write("Mean length of ORF in your organism : %s\n" % int(mean_orf/nb_gene))
         sys.stdout.write("%d genes are used for frame analysis\n" % nb_gene)
             
         ##produce boxplot
--- a/metagene_frameshift_analysis.xml	Thu Apr 09 11:35:48 2015 -0400
+++ b/metagene_frameshift_analysis.xml	Fri Apr 10 03:18:56 2015 -0400
@@ -16,7 +16,7 @@
 		<param name="reference" type="data" label="Reference annotation file (GFF)" format="gff" />
 		<param name="mapping" type="data" label="Bam file" format="bam" />
 		<param name="fasta" type="data" label="Reference genome in Fasta format" format="fasta" />
-		<param name="kmer" type="integer" label="Lenght of the best phasing footprints" value ="28"  />
+		<param name="kmer" type="integer" label="Length of the best phasing footprints" value ="28"  />
 		<param name="frame" type="integer" label="Frame where footprints show best phasing. Must be 1, 2 or 3" value ="1"  />
 		<param name="cutoff" type="integer" label="Cutoff for frame proportion in coding phase (default = 60 %)" value ="60"  />
 		<param name="orf" type="integer" label="Approximate size of the segment (in bp)" value ="300"  />		
--- a/metagene_readthrough.py	Thu Apr 09 11:35:48 2015 -0400
+++ b/metagene_readthrough.py	Fri Apr 10 03:18:56 2015 -0400
@@ -121,7 +121,7 @@
 def check_homo_coverage(gene,GFF,start,stop, aln) :
     
     chrom = GFF[gene]['chrom']
-    ## compute nunber of nucleotides in CDS with a coverage equal to zero
+    ## compute number of nucleotides in CDS with a coverage equal to zero
     nt_cds_cov = 0
     nt_cds_num = 0
     for i in range(1,GFF[gene]['exon_number']+1) :
@@ -131,7 +131,10 @@
                 nt_cds_cov += 1
                     
     ## compute percent of CDS no covering
-    percent = nt_cds_cov*100/nt_cds_num
+    if nt_cds_cov == 0 or nt_cds_num == 0:
+        percent = 0
+    else:
+        percent = nt_cds_cov*100/nt_cds_num
     
     ## compute number of nucleotides with no coverage in extension
     nt_no_cover = 0