I have to retrieve a specific information with known length from my fastq file and add it in another position.
For example given as input the following fastq file:
@SRR5394526.1 1 length=150 CGATGTTAAATCAACGATAACTACACCG +SRR5394526.1 1 length=150 AA<AFJFJJJJJJJJJJAJJJJJJJJJF
I would like as output:
@SRR5394526.1.CGATGT 1 length=150 TAAATCAACGATAACTACACCG +SRR5394526.1.CGATGT 1 length=150 FJJJJJJJJJJAJJJJJJJJJF
As you can notice the first 6 nucleotides were removed from either the sequence in the second line but also the sequence in the 4th line and appended after the first number 1 in the 1st and the 3rd lines. I have millions of chunk of this size (4 rows) within the file and this is just an example.
I have already found how to add/append info in a file:
sed 's/myinfo/&,/4' and how to remove info in a file
sed -e '423s!//!!; 424s!printf!//&!' but it's not enough. Any idea is much appreciated.