# HG changeset patch # User rlegendre # Date 1428650336 14400 # Node ID 344bacf6acb8ba435e91958eae3dcdb3c207bb7b # Parent 7c944fd9907edb31672a698d6a5c43bd4811d887 Uploaded diff -r 7c944fd9907e -r 344bacf6acb8 get_codon_frequency.py --- 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 diff -r 7c944fd9907e -r 344bacf6acb8 get_codon_frequency.xml --- 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 @@ - - + + diff -r 7c944fd9907e -r 344bacf6acb8 metagene_frameshift_analysis.py --- 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 diff -r 7c944fd9907e -r 344bacf6acb8 metagene_frameshift_analysis.xml --- 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 @@ - + diff -r 7c944fd9907e -r 344bacf6acb8 metagene_readthrough.py --- 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