pwem.convert.sequence module

class pwem.convert.sequence.SequenceHandler(sequence=None, iUPACAlphabet=0, isAminoacid=True)[source]

Bases: object

alignSeq(referenceSeq)[source]
appendFile(fileName, seqID, sequence=None, name=None, seqDescription=None, type='fasta')[source]

Appends a sequence to the sequences in a file

downloadSeqFromDatabase(seqID)[source]
getTypeFromFile(fileName)[source]

Returns the expected BioPython file type according to the filename

readSequenceFromFile(fileName, type='fasta', isAmino=True)[source]

From a sequences file, returns a dictionary with ther FIRST sequence info. Dictionary: {‘seqID’: seqID1, ‘sequence’: sequence1, ‘description’: description1, ‘alphabet’: alphabet1}

readSequencesFromFile(fileName, type='fasta', isAmino=True)[source]

From a sequences file, returns a list of dictionaries with each sequence info. Dictionary: [{‘seqID’: seqID1, ‘sequence’: sequence1, ‘description’: description1, ‘alphabet’: alphabet1},

…]

saveFile(fileName, seqID, sequence=None, name=None, seqDescription=None, type='fasta')[source]

Saves a single sequence into a specified file

saveFiles(fileName, seqIDs, sequences, names, seqDescriptions, type='fasta')[source]

Saves multiple sequences into a specified file

pwem.convert.sequence.alignBioPairwise2Sequences(structureSequenceId, structureSequence, userSequenceId, userSequence, outFileName)[source]

aligns two sequences and saves them to disk using fasta format

pwem.convert.sequence.alignClustalSequences(inFile, outFile)[source]
pwem.convert.sequence.alignMuscleSequences(inFile, outFile)[source]
pwem.convert.sequence.alphabetToIndex(isAminoacid, alphabet)[source]
pwem.convert.sequence.cleanSequence(alphabet, sequence)[source]
pwem.convert.sequence.cleanSequenceScipion(isAminoacid, iUPACAlphabet, sequence)[source]
pwem.convert.sequence.indexToAlphabet(isAminoacid, iUPACAlphabet)[source]
pwem.convert.sequence.saveFileSequencesToAlign(SeqDic, inFile, type='fasta')[source]
pwem.convert.sequence.sequenceLength(filename, format='fasta')[source]