Python program to find the indexes of Cys in the given mutlifasta sequences
You will need BioPython for this to work.
import sys
from Bio import SeqIO
FastaFile = open(sys.argv[1], 'r')
for seqs in SeqIO.parse(FastaFile, 'fasta'):
indexes = []
name = seqs.id
seq = seqs.seq
seqLen = len(seqs)
for z in range(seqLen):
if seq[z]=='c' or seq[z]=='C':
indexes.append(z+1)
print('>%s' % name)
print(indexes)
Save as Cys_index.py
and run:
python Cys_index.py out.fa
Read more here: Source link