I have below data blocks (multiple)
chr1.trna4 (17188416-17188486) Length: 71 bp
Type: Gly Anticodon: CCC at 33-35 (17188448-17188450) Score: 78.3
HMM Sc=56.60 Sec struct Sc=21.70
* | * | * | * | * | * | * |
Seq: GCATTGGTGGTTCAGTGGTAGAATTCTCGCCTCCCACGCGGGAGaCCCGGGTTCAATTCCCGGCCAATGCA
Str: >>>>>>>..>>>>.......<<<<.>>>>>.......<<<<<....>>>>>.......<<<<<<<<<<<<.
For each block, I need to find the 8th pattern on the last line of the block which start with Str. In the above case, the 8th pattern is ....... (7 periods). This is because first set of > symbols make one pattern, second set of periods make second pattern and so on.
Now I need to extract the those 7 characters from the Seq line directly above the pattern line. In the example, this corresponds to the subsequence CTCCCAC.
Output should be Seq is CTCCCAC and Anticodon: CCC
Is this is possible in bash or any shell ?
More examples of the data blocks
chr19.trna11 (4724719-4724647) Length: 73 bp
Type: Val Anticodon: CAC at 34-36 (4724686-4724684) Score: 79.2
HMM Sc=49.10 Sec struct Sc=30.10
* | * | * | * | * | * | * |
Seq: GTTTCCGTAGTGTAGCGGTtATCACATTCGCCTCACACGCGAAAGGtCCCCGGTTCGATCCCGGGCGGAAACA
Str: >>>>>>>..>>>..........<<<.>>>>>.......<<<<<.....>>>>>.......<<<<<<<<<<<<.
chr19.trna12 (1383433-1383361) Length: 73 bp
Type: Phe Anticodon: GAA at 34-36 (1383400-1383398) Score: 88.9
HMM Sc=68.40 Sec struct Sc=20.50
* | * | * | * | * | * | * |
Seq: GCCGAAATAGCTCAGTTGGGAGAGCGTTAGACTGAAGATCTAAAGGtCCCTGGTTCGATCCCGGGTTTCGGCA
Str: >>>>>>>..>>>>........<<<<.>>>>>.......<<<<<.....>>>>>.......<<<<<<<<<<<<.
chr21.trna1 (18827177-18827107) Length: 71 bp
Type: Gly Anticodon: GCC at 33-35 (18827145-18827143) Score: 80.9
HMM Sc=60.10 Sec struct Sc=20.80
* | * | * | * | * | * | * |
Seq: GCATGGGTGGTTCAGTGGTAGAATTCTCGCCTGCCACGCGGGAGGCCCGGGTTCGATTCCCGGCCCATGCA
Str: >>>>>>>..>>>>.......<<<<.>>>>>.......<<<<<....>>>>>.......<<<<<<<<<<<<.
chrX.trna4 (18693101-18693029) Length: 73 bp
Type: Val Anticodon: TAC at 34-36 (18693068-18693066) Score: 82.9
HMM Sc=54.70 Sec struct Sc=28.20
* | * | * | * | * | * | * |
Seq: GGTTCCATAGTGTAGTGGTtATCACGTCTGCTTTACACGCAGAAGGtCCTGGGTTCGAGCCCCAGTGGAACCA
Str: >>>>>>>..>>>..........<<<.>>>>>.......<<<<<.....>>>>>.......<<<<<<<<<<<<.
chrX.trna6 (3833344-3833271) Length: 74 bp
Type: Ile Anticodon: GAT at 35-37 (3833310-3833308) Score: 75.5
HMM Sc=50.20 Sec struct Sc=25.30
* | * | * | * | * | * | * |
Seq: GGCCGGTTAGCTCAGTTGGTaAGAGCGTGGTGCTGATAACACCAAGGtCGCGGGCTCGACTCCCGCACCGGCCA
Str: >>>>>>>..>>>>.........<<<<.>>>>>.......<<<<<.....>>>>>.......<<<<<<<<<<<<.
chrX.trna8 (3794915-3794842) Length: 74 bp
Type: Ile Anticodon: GAT at 35-37 (3794881-3794879) Score: 75.5
HMM Sc=50.20 Sec struct Sc=25.30
* | * | * | * | * | * | * |
Seq: GGCCGGTTAGCTCAGTTGGTaAGAGCGTGGTGCTGATAACACCAAGGtCGCGGGCTCGACTCCCGCACCGGCCA
Str: >>>>>>>..>>>>.........<<<<.>>>>>.......<<<<<.....>>>>>.......<<<<<<<<<<<<.
chrX.trna10 (3756491-3756418) Length: 74 bp
Type: Ile Anticodon: GAT at 35-37 (3756457-3756455) Score: 75.5
HMM Sc=50.20 Sec struct Sc=25.30
* | * | * | * | * | * | * |
Seq: GGCCGGTTAGCTCAGTTGGTaAGAGCGTGGTGCTGATAACACCAAGGtCGCGGGCTCGACTCCCGCACCGGCCA
Str: >>>>>>>..>>>>.........<<<<.>>>>>.......<<<<<.....>>>>>.......<<<<<<<<<<<<.
chr19.trna8 (45981945-45981859) Length: 87 bp
Type: SeC Anticodon: TCA at 36-38 (45981910-45981908) Score: 146.9
HMM Sc=0.00 Sec struct Sc=0.00
* | * | * | * | * | * | * | * | *
Seq: GCCCGGATGATCCTCAGTGGTCTGGGGTGCAGGCTTCAAACCTGTAGCTGTCTAGCGACAGAGTGGTTCAATTCCACCTTTCGGGCG
Str: >>>>>>>.>..>>>>>>....<<<<<<<<<<<<.......<<<<<<.>>>>>....<<<<<.>>>>.......<<<<<.<<<<<<<.