I have an input file looks like this:
> CD630_08510_19
Query 121 TGGCTTGGGTTTATATTTGATACTTTAGGAACATTTACAATGAGTAACATAGCCAACAGC 180
|||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||
Sbjct 121 TGGCTTGGTTTTATATTTGATACTTTAGGAACATTTACAATGAGTAACATAGCCAACAGC 180
Query 241 GCAATTGTGCTTATGCTTTTTCATGCAAGTTGGGCTACTTTTGTCCTATACAAAGATGAT 300
|||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||
Sbjct 241 GCAATTGTACTTATGCTTTTTCATGCAAGTTGGGCTACTTTTGTCCTATACAAAGATGAT 300
Query 361 CCATACTTTATAGGTATGTTTATTGGTATGGTTGGATAG 399
||||| ||||| ||||||||||||||||||| |||||||
Sbjct 361 CCATATTTTAT-GGTATGTTTATTGGTATGGCTGGATAG 398
The input file is the result file after running the command line blast. It's a txt file generated after blast alignment and in txt file header format are like this.
I am trying to extract the specific nucleotide base for position 129, 249, 366, 372 and 392 from query and subject aligned sequence. python and perl solution will be fine as well. thank you.
For example: I need my output to have format below like this:
Seq_name base_position query_base subject_base all_subject_base
CD630_08510_19 129 G T TAT-C
CD630_08510_19 249 G A
CD630_08510_19 366 C T
CD630_08510_19 372 A -
CD630_08510_19 392 T C
CD630_08510_20 129 G G GATCC
CD630_08510_20 249 G A
CD630_08510_20 366 C T
CD630_08510_20 372 A C
CD630_08510_20 392 T C
all_subject_base: are the bases from position 129, 249, 366, 372 and 392 of subject_base column. I want to keep this in one column thats why all_subject_base.
I tried to extract this with grep but have not been able to. I am new in bioinformatics so any suggestion would be very helpful.