This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How I deal with different lanes in RNA-seq alignment

Hi

I have Four lanes per sequencing run => 4 fastqs each so for each patient I have 16 Fastq files

I am using STAR for alignment by this code (each lane)

STAR --genomeDir ./hg38_Genome --readFilesIn ./fastq1./fastq2

At the end I would have 4 sam files

Should I merge sam files from each lane or I should merging lane when alignment by STAR?

Any help please?

Thank you

rna-seq star alignment

4 answers

I'd merge the FASTQs as that is easier.

You don't have to concatenate your files beforehand when using STAR. Adding the files of read1 (followed by read 2 if using paired end data) separated by comma should do the trick and save you time: STAR --readFilesIn file1_1.fastq,file2_1.fastq file1_2.fastq,file2_2.fastq

Are you sure they won't be treated as different samples when comma-separated values are used? The manual states that this syntax is for multi-sample alignment.

It won't! I have processed several datasets where one sample comes with multiple .fastq files due to sequencing depth. It's essentially the same as concatenate - I, of course, tested before using. It's important not to put spaces between the files when you're feeding --readFilesIn.

Looks like the STAR manual is wrong, then. It is the second most disappointing manual, right after RSEM.

If they are from the same replicate and are just spread across lanes to achieve more depth, you may as well merge them before alignment.

Thank you, the reads are paired end so should I do like below?

STAR --genomeDir ./hg38_Genome --readFilesIn ./fastq1_lane1 ./fastq1_lane2 ./fastq1_lane3 ./fastq1_lane4 ./fastq2_lane1 ./fastq2_lane2 ./fastq2_lane3 ./fastq2_lane4

Use cat to concatenate them into a single file per forward and reverse read.

Sorry how? I mean use cat for locating the folders? or what?

concatenating the individual fastq files into one file

cat test_rep1.fasta 
ATGC

cat test_rep2.fasta 
TGCATGC

# merge together
cat test_rep1.fasta > merged.fasta
cat test_rep2.fasta >> merged.fasta

cat merged.fasta 
ATGC
TGCATGC

As ATpoint said, concatenate the R1 files together with unix's cat command (you can do this on the compressed files), and do the same to the R2 files, and give those two combined files to STAR. But you can merge the bams together after the fact if you like with samtools merge.

Or, ask the people who made the fastqs for you to remake them with --no-lane-splitting.

Sorry when I'm sorting my sam file by samtools sort -n I have one million non unique mapped reads after getting raw read counts by htseq but when I'm using picard samsort I only have 200000 non unique mapped reads

In your experiences what I'm doing wrong ?

Non unique mapped reads are too bad?

Should I use picard samsort then?

Log in to answer this question.