Hi,
I have a file looking like this
@HISEQ:229:C81CCANXX:1:1101:10157:17161/1
AAAAAAAAAAAAAAAAAAAA
+
CCCCCGGGG/1GGGGGGCEEG
@HISEQ:229:C81CCANXX:1:1101:10741:22239/1
GCCTTGCTATTGACTCTACT
+
BBBB@EEGGGGGDGGEGGGG
@HISEQ:229:C81CCANXX:1:1101:10901:88419/1
GCTTAGGGATTTTATTGGTA
I would like to remove this /1 at the end of the lines (read names).
I did
sed -i -e 's/\/1//g' MyFile.txt
But the problem is that is also removes the /1 occurring in the middle of the 4th line (sequence quality).
Is there a way to substitute the /1 only on lines starting with @HISEQ (a sort of conditional expression) ?
I also tried:
awk -F "/" '/^@HISEQ/{ $2 = "" ; print $0 }' essai.change.name> file.txt
The problem then is that I have only the @HISEQ lines and I loose the lines in between.
Thank you!
C. Anna
Avoid the -i flag on sed if you are not sure what you are doing, better would be to just pipe the result to e.g. head to check if the command performed as you thought.