This is a test version of Biostars. For the public version, visit https://www.biostars.org.
STAR aligner fails to produce unmapped file

Hello,

I'm trying to generate an unmapped bam file for further processing using STAR alignment.

but I've tried numerous iterations of this command

/usr/bin/time STAR --outSAMtype BAM SortedByCoordinate --outSAMattributes All --genomeDir /home/con/GENE_DATA/mm10 --readFilesIn TN_R2_cat.fastq
  /usr/bin/time STAR --outSAMtype BAM SortedByCoordinate --outSAMattributes All --genomeDir /home/con/GENE_DATA/mm10 --readFilesIn TN_R2_cat.fastq 2> STAR.err &
  cat STAR.err 
  echo "/usr/bin/time STAR --outSAMtype BAM SortedByCoordinate --outSAMattributes All --genomeDir /home/con/GENE_DATA/mm10 --readFilesIn TN_R2_cat.fastq 2> STAR.err &" >> notes.txt 
  /usr/bin/time STAR --outSAMtype BAM SortedByCoordinate --outSAMattributes All --genomeDir /home/con/GENE_DATA/mm10 --readFilesIn TN_R2_cat.fastq --outSAMunmapped
  /usr/bin/time STAR --outSAMtype BAM SortedByCoordinate --outSAMattributes All --genomeDir /home/con/GENE_DATA/mm10 --readFilesIn TN_R2_cat.fastq --outSAMunmapped='unmapped'
  /usr/bin/time STAR --outSAMtype BAM SortedByCoordinate --outSAMattributes All --genomeDir /home/con/GENE_DATA/mm10 --readFilesIn TN_R2_cat.fastq --outSAMunmapped='unmapped'
  /usr/bin/time STAR --outSAMtype BAM SortedByCoordinate --outSAMattributes All --genomeDir /home/con/GENE_DATA/mm10 --outReadsUnmapped --readFilesIn TN_R2_cat.fastq 
  /usr/bin/time STAR --outSAMtype BAM SortedByCoordinate --outSAMattributes All --genomeDir /home/con/GENE_DATA/mm10 --outReadsUnmapped='fastx' --readFilesIn TN_R2_cat.fastq 
  /usr/bin/time STAR --outSAMtype BAM SortedByCoordinate --outSAMattributes All --genomeDir /home/con/GENE_DATA/mm10 --outReadsUnmapped='fastx' --runThreadN 2 --readFilesIn TN_R2_cat.fastq 
  /usr/bin/time STAR --outSAMtype BAM SortedByCoordinate --outSAMattributes All --genomeDir /home/con/GENE_DATA/mm10 --outReadsUnmapped='fastx' --readFilesIn TN_R2_cat.fastq 
  /usr/bin/time STAR --outSAMtype BAM SortedByCoordinate --outSAMattributes All --genomeDir /home/con/GENE_DATA/mm10 --outReadsUnmapped='fastx' --readFilesIn TN_R2_cat.fastq 
  /usr/bin/time STAR --outSAMtype BAM SortedByCoordinate --outSAMattributes All --genomeDir /home/con/GENE_DATA/mm10 --outReadsUnmapped --readFilesIn TN_R2_cat.fastq 
  /usr/bin/time STAR --outSAMtype BAM SortedByCoordinate --outSAMattributes All --genomeDir /home/con/GENE_DATA/mm10 --outReadsUnmapped='unmapped' --readFilesIn TN_R2_cat.fastq 
  STAR   --genomeDir /home/con/GENE_DATA/mm10   --readFilesIn TN_R2_cat.fastq      --outReadsUnmapped unmapped   --outSAMtype BAM   SortedByCoordinate      --outSAMattrib
  STAR --genomeDir /home/con/GENE_DATA/mm10 --readFilesIn TN_R2_cat.fastq --outReadsUnmapped unmapped SortedByCoordinate  --outSAMattributes All
  STAR --genomeDir /home/con/GENE_DATA/mm10 --readFilesIn TN_R2_cat.fastq --outReadsUnmapped unmapped SortedByCoordinate  --outSAMattributes All
  STAR   --genomeDir /home/con/GENE_DATA/mm10   --readFilesIn TN_R2_cat.fastq --outSAMattributes All --outSAMunmapped=unmapped
  STAR   --genomeDir /home/con/GENE_DATA/mm10   --readFilesIn TN_R2_cat.fastq --outSAMattributes All --outReadsUnmapped=fast

but I cannot get the output Unmapped.out.mate1/2 that the manual promises How can I get STAR to produce the unmapped file? What am I getting wrong from the manual?

star

2 answers

The flag to set is just --outReadsUnmapped Fastx.

thanks WouterDeCoster!

try not to use SortedByCoordinate, get the output in sam format

try using this argument in your command and lets see if you get

--outReadsUnmapped Fastx

--outSAMtype BAM SortedByCoordinate works together with --outReadsUnmapped Fastx

Log in to answer this question.