This is a test version of Biostars. For the public version, visit https://www.biostars.org.
STAR after reverse complement with python

I am using STAR after reverse complement my fastq file using python. I got this error massage:

EXITING because of FATAL ERROR in reads input: quality string length is not equal to sequence length
@NB551014:247:HWFGLBGXH:1:11101:16966:1027
TAGCTTATCAGACTGATGTTGACT
EEEEEEEEEEAEEEEEEEEAAAAA
SOLUTION: fix your fastq file

But when I am looking on my fastq I cannot see the problem:

My fastq file before reverse complement looks like this:

@NB551014:247:HWFGLBGXH:1:11101:16966:1027 2:N:0:CGATGT
AGTCAACATCAGTCTGATAAGCTA
+
AAAAAEEEEEEEEAEEEEEEEEEE

My fastq file after reverse complement looks like this:

@NB551014:247:HWFGLBGXH:1:11101:16966:1027 2:N:0:CGATGT
TAGCTTATCAGACTGATGTTGACT
+
EEEEEEEEEEAEEEEEEEEAAAAA
@NB551014:247:HWFGLBGXH:1:11101:14914:1029 2:N:0:CGATGT
AAGCTGCCAGTTGAAGAACTGT
+
EEEAEAEE<E/EAEEEEAAAAA
@NB551014:247:HWFGLBGXH:1:11101:16926:1034 2:N:0:CGATGT
TGAGGTAGTAGGTTGTATAGTT

I used this code to reverse complement my fastq:

seq = open(working_dir +"RC_" + filename, "w")
 with open(working_dir + filename,"r") as handle:     
            for i in SeqIO.parse(handle, "fastq"):             
                reverse = i.reverse_complement()   
                i.seq = reverse.seq
                i.letter_annotations = reverse.letter_annotations
                SeqIO.write(i, seq, "fastq")


        seq.close()        

I think there is other problem with my fastq file when create it with python script but I cannot find the mistake. Thanks, Tam

biopython star

STAR after reverse complement my fastq file using python

Why did you feel a need to do that? STAR should do this internally as it aligns the data.

Note: Is the + separator in line 3 missing from the offending record?

Hi, Because of experiments issue I am using R2 sequencing for single cell RNA, this is why I thought I need to do reverse complement. Do I? Does STAR can do it while align?

** Is the + separator in line 3 missing from the offending record? yes, But I see it while looking at my fastq file.

You do not need to reverse complement your reads. STAR will do this for you. As for what is actaully wrong.... I can't see anything, which could mean that you have a problem with non-printing characters? If you really wanted to find out what was going on, try running it throught cat -A. But the real solution to the problem is not to bother with the rev comp in the first place.

Thank you. I will do it.

0 answers

No answers yet.

Log in to answer this question.