Answers.Body: <p>I don't think FeatureCounts is meant to work on an alignment to the transcriptome.  It's not at all clear to me that the subread aligner, or any aligner, is meant to be used on a transcriptome.</p>
  <p>If you have the transcriptome, I'd just use pseudoaligners like Kallisto or Salmon.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-09T20:43:07.443Z
Answers.Text: well i think it does, at least according to the user manual. And feature counting is mandatory step after alignment to the index. Not that i am an expert .IS Kallisto Windows compatible? I am not familiar with Linux...
Answers.UserDisplayName: MKE1508
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-09T20:55:23.123Z
Answers.Text: Aligners can definitely be used on a transcriptome. That's done all the time on non-model organisms for which full genome is not available. I don't think the Rsubread aligner is different in that sense.
Answers.UserDisplayName: Cloudberry
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-10T16:33:54.737Z
Answers.Text: But they aren't going to handle ambiguous alignments properly, like a psudoaligner would.
Answers.UserDisplayName: swbarnes2
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-08T19:25:03.613Z
Answers.LastActivityDate: 2024-01-08T19:25:03.613Z
Answers.UserDisplayName: swbarnes2
Body: <p>I did manage to bild index file (from NCBI transcriptome) and perform alingment in Rsubread in R with my fq files. I did get BAM files as a result and no error. However i am having trouble with next step as featurecount function does not produce any result( 0%). I have tried builtin annotation (hg38)</p>
  <p>i am wondering if BAM files are ok..</p>
  <p>this is the code i have used</p>
  <pre><code>library(Rsubread)
  index_path &lt;- &quot;D:/FASTQ_Raw/hum_transcr&quot;
  all_files &lt;- list.files(path = &quot;D:/FASTQ_Raw&quot;, pattern = &quot;.fq<span class="math-container">$", full.names = TRUE)
  common_prefixes &lt;- unique(gsub("_[12]\\.fq$</span>&quot;, &quot;&quot;, basename(all_files)))
  
  output_directory &lt;- &quot;aligned_reads/&quot;
  
  dir.create(output_directory, showWarnings = FALSE)
  
  for (prefix in common_prefixes) {
   
    read1_file &lt;- paste0(&quot;D:/&quot;, prefix, &quot;_1.fq&quot;)
    read2_file &lt;- paste0(&quot;D:/&quot;, prefix, &quot;_2.fq&quot;)
    
    output_file &lt;- paste0(output_directory, prefix, &quot;_aligned.bam&quot;)
    
  
    align(index = index_path,
          readfile1 = read1_file,
          readfile2 = read2_file,
          output_file = output_file,
          nthreads = 4) 
  }
  </code></pre>
  <p>so the results/stats of individual BAMs appear ok still when i try featurecount function on BAM files i get zero....i was also using built in annotation index hg38 for attempt of counting but it does not work. I had issues with getting  gtf file from NCBI. What do you recommend ?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-09T20:08:50.853Z
Comments.Text: How did you run `featureCounts()` and what was the output? Are you sure your reference and gtf file are compatible?
Comments.UserDisplayName: Cloudberry
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-09T20:38:28.173Z
Comments.Text: Well i have created Index file in first step from .fa transcriptome file from NCBI ( for gh38.14). Howeverr there i had problem of opening gtf file. I did download one from ensembl but i am not sure if they are 100 % compatible ( they should be i guess). Because of this i have tried Builtinannotation function from Rsubread but this yielded 0% alignment. I was hoping to do everything in R because i am beginer with seq analysis and with R I have at least some experience with different packages.
Comments.UserDisplayName: MKE1508
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-09T20:46:55.893Z
Comments.Text: NCBI and Ensembl use a different format for chromosome names. That's probably why you didn't get any results. The fasta and gtf must be from the same dataset.
Comments.UserDisplayName: Cloudberry
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-09T20:53:55.137Z
Comments.Text: Many Thanks!! I will retry with NCBI gtf file. Alignment was quite reasonable (over 90%) so it should work...
Comments.UserDisplayName: MKE1508
Tags: <r><rna-seq><bioconductor><featurecounts>
Title: problem with feature counts of RNA bulk seq paired data- in Rsubread
ThreadText: # problem with feature counts of RNA bulk seq paired data- in Rsubread
  
  (Asked by: username_0 on 2024-01-06)
  
  I did manage to bild index file (from NCBI transcriptome) and perform alingment in Rsubread in R with my fq files. I did get BAM files as a result and no error. However i am having trouble with next step as featurecount function does not produce any result( 0%). I have tried builtin annotation (hg38)
  
  i am wondering if BAM files are ok..
  
  this is the code i have used
  
  ```
  library(Rsubread)
  index_path <- "D:/FASTQ_Raw/hum_transcr"
  all_files <- list.files(path = "D:/FASTQ_Raw", pattern = ".fq$", full.names = TRUE)
  common_prefixes <- unique(gsub("_[12]\\.fq$", "", basename(all_files)))
  
  output_directory <- "aligned_reads/"
  
  dir.create(output_directory, showWarnings = FALSE)
  
  for (prefix in common_prefixes) {
   
    read1_file <- paste0("D:/", prefix, "_1.fq")
    read2_file <- paste0("D:/", prefix, "_2.fq")
    
    output_file <- paste0(output_directory, prefix, "_aligned.bam")
    
  
    align(index = index_path,
          readfile1 = read1_file,
          readfile2 = read2_file,
          output_file = output_file,
          nthreads = 4) 
  }
  
  ```
  
  so the results/stats of individual BAMs appear ok still when i try featurecount function on BAM files i get zero....i was also using built in annotation index hg38 for attempt of counting but it does not work. I had issues with getting gtf file from NCBI. What do you recommend ?
  
  **Tags:** r, rna-seq, bioconductor, featurecounts
  
  > **Comments:**
  > **username_1**: How did you run `featureCounts()` and what was the output? Are you sure your reference and gtf file are compatible?  
  > **username_0**: Well i have created Index file in first step from .fa transcriptome file from NCBI ( for gh38.14). Howeverr there i had problem of opening gtf file. I did download one from ensembl but i am not sure if they are 100 % compatible ( they should be i guess). Because of this i have tried Builtinannotation function from Rsubread but this yielded 0% alignment. I was hoping to do everything in R because i am beginer with seq analysis and with R I have at least some experience with different packages.  
  > **username_1**: NCBI and Ensembl use a different format for chromosome names. That's probably why you didn't get any results. The fasta and gtf must be from the same dataset.  
  > **username_0**: Many Thanks!! I will retry with NCBI gtf file. Alignment was quite reasonable (over 90%) so it should work...  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2024-01-08. Score: -1
  
  I don't think FeatureCounts is meant to work on an alignment to the transcriptome. It's not at all clear to me that the subread aligner, or any aligner, is meant to be used on a transcriptome.
  
  If you have the transcriptome, I'd just use pseudoaligners like Kallisto or Salmon.
  
  > **Comments:**
  > **username_0**: well i think it does, at least according to the user manual. And feature counting is mandatory step after alignment to the index. Not that i am an expert .IS Kallisto Windows compatible? I am not familiar with Linux...  
  > **username_1**: Aligners can definitely be used on a transcriptome. That's done all the time on non-model organisms for which full genome is not available. I don't think the Rsubread aligner is different in that sense.  
  > **username_2**: But they aren't going to handle ambiguous alignments properly, like a psudoaligner would.  
  
  ---
  
  