I don't know if this is of any particular consequence for what you want to do, but you've missed an L out in ILLUMINA. You may also want to consider changing the substitution to:
/^@/@ILUMINA:/ since all the fields in the header lines are : delimited, and this might make it easier to separate out the string later on.
Use at own risk though, as messing with the FASTQ headers is liable to break other programs.
simply run the
sedcommand on your original file to modify it, omitting the grep partKeep in mind though that the original will then not be present anymore (as you will have changed it), a better approach might be to redirect it to a new file
this might not be restrictive enough though, as it will also change all other occurrences of '@'
re: "simply run the
sedcommand" - note: you must pass-ito modify it in place (assuming GNUsed)That's not really something I would advise to novice users. Great way to lose your input data.
Agreed. Don't use the
-iswitch unless you're really sure what the sed does and you're sure you don't need the unmodified content later.i just want change the each id of my reads . i think the way you recommend will change the quality also. the "grep '^@.*/1'" in my command just restrict the row i want to change to the id line in my fastq file. anyway ,thanks a lot
Your grep command wouldn’t have solved that issue anyway, as it would still match a quality line that begins with
@never use '@' as a signal that the line is the header, because '@' is also a valid character for the fastq quality.
Out of curiosity: why do you want to add "ILLUMINA" to every header?
just a example , i just want to prefix the id. because the stupid sequencing company give me the pair-end fastq file whose id like this : @307/1 it cant support me to do markduplicate in GATK that really make me mad :(
And adding "ILLUMINA" to the headers will make markduplicate work? Are you referring to Picard MarkDuplicates? I thought it was supposed to work on bam files, not on fastq files.
Did you ask the sequencing company why the headers are like this? Illumina headers follow a different naming convention.
beacause picard just told me "Value was put into PairInfoMap more than once", and when i find solution on the net , i just find someone said this error results from some lane id in the fastq file is repeat. so i just want to edit the id of reads to solve it . this way really solve the problem at least now. maybe the way you told me works well ,but i dont how to do it. :(
If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.
