Hello, I am looking for printing a specific length of amino acids before and after a motif. For example, See below sequence where the bold is motif. I need to print 83 residues before it and 254 residues after it.
HTRVTGGSAAHATNTFTSFFSQGAKQGVQLVNTNGSWHVNRTALNCNASLETGWVAGLFYYHKFNSSGCP ERMASCRPLADFDQGWGPISYANGSGPEHRPYCWHYPPKPCGIVPAQTVCGPVYCFTPSPVVVGTTDKFG VPTYNWGENETDVPVLNNTRPPLGNWFGCTWMNSSGYTKVCGAPPCVIGGVGNNTLHCPTDCFRKHPEAT YSRCGSGPWITPRCLVDYPYRLWHYPCTINYTLFKVRMYVGGVEHRLEAACNWTRGERCDPDDRDRSELS PLLLSTTQWQVLPCSFTTLPALTTGLIHLHQNIVDVQYLYGMGSSIVSWAIKWEYVILLFLLLADARICS CLWMMLLI
Thanks.
Reaz
Do you have a file containing the motifs or something like that?
Yes I do have a file. How can I share?
I see you want to use perl, in which case I can't help you. But as a follow up question to get your problem a bit clearer, it's always the same motif, and the sequences are in fasta format?
In Python (which I can help with) you could do things like (pseudocode)
seqstring.index('QGWGP')
to get the position of your motif in the sequence fragment, which then (knowing the total length) would be pretty straightforward to calculate the length before and after.But very very likely perl will have an alternative (or multiple alternatives) to do the same thing.
Thanks I am working on other suggestions.