Notices
 

Python Code for extracting pattern

For page specific messages
For page author info

Uses lists and slicing in python

I got another chance to write (or modify my last code) python code for extracting pattern. The pattern is about extracting 25 characters before and after sqaure bracket []. Suppose, we have a line in file like:

"marker_13_chr1_35346817""TGAAAAGAATAGCAAAGAAGAGAAAGTGTTGCCATTATAAGGGCATTTTT[K]AGGACACATGTTCTTACATTCATTGGTGCCTTTTTCCTATAAATATTCTC"""

 

Now, we needed output like this:

GTGTTGCCATTATAAGGGCATTTTT[K]AGGACACATGTTCTTACATTCATTG

Here, output is sqaure brackets of line i.e. [k] including 25 character before and after of square brackets.

 

Enjoy.....

 

 

 
X