Answers.Body: <p>It depends what you mean by &quot;technical replicates&quot;.  If it is the exact same library prep spread out over two lanes, or two flowcells, they must be combined at the fastq stage.  Cellranger will naturally do this with fastqs that keep their original Illumina-assigned names, but just have the files split by lane.</p>
  <p>If one file has a read from a gene with a particular cell barcode and UMI, and another read in a separate file but <strong>the same library prep</strong> has a read from the same gene, with the same barcode and same UMI, those two must <strong>not</strong> be both counted. So if you combine the counts, that's wrong.</p>
  <p>A NextSeq naturally has 4 lanes, so that's almost certainly what you are looking at.  The read names would confirm that, unless they've been altered.  Cat them all together, or alter their names so that they match the original Illumina specs with lanes 1-4.  You might have to do that anyway, cellranger used to be very picky about that, and might still be.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-11T16:44:12.240Z
Answers.Text: Agreed on all of that. If you alter names though then furst make a new folder, symlink files into that and alter the symlink names. Don't  alter names of actual files, that's error-prone.
Answers.UserDisplayName: ATpoint
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-09T17:00:02.367Z
Answers.LastActivityDate: 2023-06-09T17:06:02.280Z
Answers.LastEditDate: 2023-06-09T17:06:02.280Z
Answers.UserDisplayName: swbarnes2
Answers.Body: <p>If they are truly technical replicates in the most specific sense (e.g. from the same extraction and library prep, just split up for sequencing), then the counts for each identified cell can be combined (i.e. added together). One way to do this is to concatenate the files prior to running any data processing scripts.</p>
  <p>If there is anything different about the runs, then they should be treated as non-technical replicates and properly integrated:</p>
  <p><a href="https://satijalab.org/seurat/articles/integration_rpca.html" rel="nofollow noreferrer">https://satijalab.org/seurat/articles/integration_rpca.html</a></p>
  <p>We had a situation with Rhapsody single cell data where a library was split into three on three different cell barcode plates, and was showing a small amount of library preparation bias that influenced clustering. Carrying out an integration of the libraries helped to reduce this bias.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-09T17:03:03.727Z
Answers.Text: Catting the fastqs will not be the same as combining the counts.  If the catted fastqs are processed by cellranger, deduplication will be handled properly.  If the fastqs are processed separately, you will overcount, because duplicates between runs will not be accounted for.
Answers.UserDisplayName: swbarnes2
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-08T21:04:14.083Z
Answers.LastActivityDate: 2023-06-08T21:04:14.083Z
Answers.UserDisplayName: gringer
Answers.Body: <p>After some digging, it seems like each of the 4 runs has I1, R1 and R2 files - they're replicates.</p>
  <p>You can either</p>
  <ol>
  <li>run them separately and then perform <code>cellranger aggr</code>; or</li>
  <li>link to all 12 files using soft-links that follow a proper naming convention (the files need to have the same prefix, lane numbers need to be different per replicate), ensure all softlinks are in the same directory, then use the directory with <code>cellranger count</code>.</li>
  </ol>
  <p>I'd recommend the former approach as it will probably save a little compute time, is parallelize-able and will be easier to debug/drill down into.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-09T17:09:57.590Z
Answers.Text: using cell aggr is totally wrong  If you had 4 different samples, it would be a coincidence if some of them happened to have the same barcode, and the right thing to do would be to treat those as two separate cells.  With this, if the same cell barcode turns up in each lane, it's actually the same cell, and they should be combined.
Answers.UserDisplayName: swbarnes2
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-08T17:55:53.600Z
Answers.LastActivityDate: 2023-06-08T17:55:53.600Z
Answers.UserDisplayName: Ram RS
Body: <p>I'm working with cellranger count to annotate some publicly available fastq files (<a href="https://www.ncbi.nlm.nih.gov/sra/SRX7888073%5Baccn%5D" rel="nofollow noreferrer">SRX7888073</a>). For each sample, 4 runs are available, which I assume represent technical replicates.</p>
  <p>How do you recommend to handle them in cellranger? Are they 4 different samples (i.e. 4 separate runs), or 1 sample with 4 lanes?</p>
  <p>Thank you !</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-08T16:32:50.160Z
Comments.Text: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Comments.UserDisplayName: Community
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-08T16:38:01.227Z
Comments.Text: Welcome @David, nice you joined us. It could be helpful if you could point to the information on the site, ie. "Male 3; Schistosoma mansoni; RNA-Seq". Thats kinda key, clicking offsite links to answer questions is sort of discouraged. The actual experimental details will be explained on the site ...
Comments.UserDisplayName: M__
Tags: <scrnaseq><cellranger>
Title: How to handle technical replicates in cellranger count?
ThreadText: # How to handle technical replicates in cellranger count?
  
  (Asked by: username_0 on 2023-06-08)
  
  I'm working with cellranger count to annotate some publicly available fastq files ([SRX7888073](https://www.ncbi.nlm.nih.gov/sra/SRX7888073%5Baccn%5D)). For each sample, 4 runs are available, which I assume represent technical replicates.
  
  How do you recommend to handle them in cellranger? Are they 4 different samples (i.e. 4 separate runs), or 1 sample with 4 lanes?
  
  Thank you !
  
  **Tags:** scrnaseq, cellranger
  
  > **Comments:**
  > **username_1**: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.  
  > **username_2**: Welcome @username_0, nice you joined us. It could be helpful if you could point to the information on the site, ie. "Male 3; Schistosoma mansoni; RNA-Seq". Thats kinda key, clicking offsite links to answer questions is sort of discouraged. The actual experimental details will be explained on the site ...  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_3 on 2023-06-09. Score: 3
  
  It depends what you mean by "technical replicates". If it is the exact same library prep spread out over two lanes, or two flowcells, they must be combined at the fastq stage. Cellranger will naturally do this with fastqs that keep their original Illumina-assigned names, but just have the files split by lane.
  
  If one file has a read from a gene with a particular cell barcode and UMI, and another read in a separate file but **the same library prep** has a read from the same gene, with the same barcode and same UMI, those two must **not** be both counted. So if you combine the counts, that's wrong.
  
  A NextSeq naturally has 4 lanes, so that's almost certainly what you are looking at. The read names would confirm that, unless they've been altered. Cat them all together, or alter their names so that they match the original Illumina specs with lanes 1-4. You might have to do that anyway, cellranger used to be very picky about that, and might still be.
  
  > **Comments:**
  > **username_4**: Agreed on all of that. If you alter names though then furst make a new folder, symlink files into that and alter the symlink names. Don't  alter names of actual files, that's error-prone.  
  
  ---
  
  ### Answer by username_5 on 2023-06-08. Score: 2
  
  If they are truly technical replicates in the most specific sense (e.g. from the same extraction and library prep, just split up for sequencing), then the counts for each identified cell can be combined (i.e. added together). One way to do this is to concatenate the files prior to running any data processing scripts.
  
  If there is anything different about the runs, then they should be treated as non-technical replicates and properly integrated:
  
  <https://satijalab.org/seurat/articles/integration_rpca.html>
  
  We had a situation with Rhapsody single cell data where a library was split into three on three different cell barcode plates, and was showing a small amount of library preparation bias that influenced clustering. Carrying out an integration of the libraries helped to reduce this bias.
  
  > **Comments:**
  > **username_3**: Catting the fastqs will not be the same as combining the counts.  If the catted fastqs are processed by cellranger, deduplication will be handled properly.  If the fastqs are processed separately, you will overcount, because duplicates between runs will not be accounted for.  
  
  ---
  
  ### Answer by username_6 on 2023-06-08. Score: 0
  
  After some digging, it seems like each of the 4 runs has I1, R1 and R2 files - they're replicates.
  
  You can either
  
  1. run them separately and then perform `cellranger aggr`; or
  2. link to all 12 files using soft-links that follow a proper naming convention (the files need to have the same prefix, lane numbers need to be different per replicate), ensure all softlinks are in the same directory, then use the directory with `cellranger count`.
  
  I'd recommend the former approach as it will probably save a little compute time, is parallelize-able and will be easier to debug/drill down into.
  
  > **Comments:**
  > **username_3**: using cell aggr is totally wrong  If you had 4 different samples, it would be a coincidence if some of them happened to have the same barcode, and the right thing to do would be to treat those as two separate cells.  With this, if the same cell barcode turns up in each lane, it's actually the same cell, and they should be combined.  
  
  ---
  
  