PEATDB/DNA_sequence.py
def read_fastamult(self,filename):
        """Read a fasta database file, i.e. multiple (or a single) sequences"""
        fd=open(filename)
        lines=fd.readlines()
        fd.close()
        sequences=[]
        count=0
        buffer=''
        ID=None
        while 1:
            if count==len(lines):
                if buffer!='':
                    sequences.append([ID,buffer.replace(' ','')])
                break
            line=lines[count]
            if len(line.strip())==0:
                count=count+1
                continue
            if line.strip()[0]=='>':
                if buffer!='':
                    sequences.append([ID,buffer.replace(' ','')])
                ID=line.strip()[1:]
                buffer=''
            else:
                buffer=buffer+line.strip()
            count=count+1
        return sequences
Read a fasta database file, i.e. multiple (or a single) sequences
Read a fasta database file, i.e. multiple (or a single) sequences
Read a fasta database file i . e . multiple ( or a single ) sequences
def read_fastamult(self,filename):
        fd=open(filename)
        lines=fd.readlines()
        fd.close()
        sequences=[]
        count=0
        buffer=''
        ID=None
        while 1:
            if count==len(lines):
                if buffer!='':
                    sequences.append([ID,buffer.replace(' ','')])
                break
            line=lines[count]
            if len(line.strip())==0:
                count=count+1
                continue
            if line.strip()[0]=='>':
                if buffer!='':
                    sequences.append([ID,buffer.replace(' ','')])
                ID=line.strip()[1:]
                buffer=''
            else:
                buffer=buffer+line.strip()
            count=count+1
        return sequences
def read_fastamult ( self , filename ) : fd = open ( filename ) lines = fd . readlines ( ) fd . close ( ) sequences = [ ] count = 0 buffer = '' ID = None while 1 : if count == len ( lines ) : if buffer != '' : sequences . append ( [ ID , buffer . replace ( ' ' , '' ) ] ) break line = lines [ count ] if len ( line . strip ( ) ) == 0 : count = count + 1 continue if line . strip ( ) [ 0 ] == '>' : if buffer != '' : sequences . append ( [ ID , buffer . replace ( ' ' , '' ) ] ) ID = line . strip ( ) [ 1 : ] buffer = '' else : buffer = buffer + line . strip ( ) count = count + 1 return sequences
Read a fasta database file, i.e.
Read a fasta database file i . e .
"""Read a fasta database file, i.e. multiple (or a single) sequences"""
self
filename