Skip to content

Commit

Permalink
corrected filterReads.new.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lpryszcz committed Mar 6, 2014
1 parent 2a605ca commit 3d7287a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cuffdiff2de.py
Expand Up @@ -101,7 +101,7 @@ def load_cuffdiff(handle):
def report(files, pfam, annotation, tab, pTh, verbose):
""" """
#load pfam annotation
geneid2pfam, geneid2annotation = {},{}
geneid2pfam, geneid2annotation, geneid2tab = {}, {}, {}
if pfam:
geneid2pfam = load_pfam_tblout(pfam)
sys.stderr.write(" PFAMs for %s entries loaded.\n" % len(geneid2pfam))
Expand Down Expand Up @@ -160,7 +160,7 @@ def report(files, pfam, annotation, tab, pTh, verbose):
lineData.append( "; ".join(annList))
#add tab annotation
annList=[]
if transid in geneid2tab:
if geneid2tab and transid in geneid2tab:
annList.append(";".join(geneid2tab[transid]))
lineData.append( "; ".join(annList))
#add Arabidopsis annotation
Expand Down
7 changes: 4 additions & 3 deletions embl2gtf.py
Expand Up @@ -32,7 +32,7 @@ def _get_unique_id( gene_id,products,i=1 ):

return new_id

def embl2gtf( source='embl2gtf',allowedTypes=set(['gene', 'CDS', 'tRNA', 'tmRNA', 'rRNA', 'ncRNA']) ): #'mRNA',
def embl2gtf( source='embl2gtf',allowedTypes=set(['CDS', 'tRNA', 'tmRNA', 'rRNA', 'ncRNA']) ): #'mRNA', 'gene',
"""
"""
#make sure no duplicated products
Expand Down Expand Up @@ -67,8 +67,9 @@ def embl2gtf( source='embl2gtf',allowedTypes=set(['gene', 'CDS', 'tRNA', 'tmRNA'

#make sure no duplicated entries in GTF
if gene_id in products:
sys.stderr.write( "Warning: Duplicated entry found: %s\n" % '; '.join( str(f).split('\n') ) )
gene_id = transcript_id = _get_unique_id( gene_id,products ) #continue
#sys.stderr.write( "Warning: Duplicated entry found: %s\n" % '; '.join( str(f).split('\n') ) )
continue
#gene_id = transcript_id = _get_unique_id( gene_id,products ) #continue

products.add(gene_id)

Expand Down
2 changes: 1 addition & 1 deletion filterReads.new.py
Expand Up @@ -454,7 +454,7 @@ def main():
exit(-2)

## Check if prefix is endend with '.' or '_'. Otherwise, add '.' at the end
if o.prefix != None and not o.prefix[-1] in ['.', '_']:
if o.prefix and not o.prefix[-1] in ['.', '_']:
o.prefix += '.'

## We pass file descriptors to the main functions
Expand Down

0 comments on commit 3d7287a

Please sign in to comment.