# making a customer reference by using cell ranger

Anyone here knows how to add a new gene (GFP) to customer reference by using cellranger? We use the Cre/loxp system by using R26RmTmG mice and want to use GFP to isolate specific cells. I have read the cellranger workflow but still, have no idea how to do it. Like it is said that I should update the GTF file as shown in the screenshot.

>GFP_name
ATG.....TAA


Step 2: Annotate the gtf so that it contains all the necessary information to annotate your information

Add this line to your GTF file but modify where necessary: "Make sure that all columns are tab separated"

GFP_name    AddedGene   exon    1   1966    .   +   1   gene_id "GFP"; transcript_id "GFP"; gene_name "GFP"; transcript_name "GFP"

• The first column has to correspond to the header of the fasta sequence
• start and end indicates the length of your sequence. I added a 1966 bp long sequence to my gtf

Code example: step 1:

cat reference.fa gfp_seq.fa > new_reference.fa


step 2:

cat genes.gtf gfp.gtf > new_genes.gtf


- gfp_seq.fa is your custom gene in fasta file - gfp.gtf is your custom gtf line or lines if you want to add more

You can also open your current reference fasta and gtf file in a text editor and copy paste the sequence and gtf line in there.

Then run cellranger mkref on your new_reference and new_genes file

• Hi Mack, thank you for your reply. And I was still wandering whether "the genes.gtf" in Code2 "cat genes.gtf gfp.gtf > new_genes.gtf " is the gtf that had to be filtered before or after Code 2 to proceed filter step?
– hua
Jul 26 '19 at 16:06
• You can add this line to the filtered gtf file. You can download the gtf file for your species of interest, format it for cellranger using the mkgtf function. The output.gtf will be used together with your reference.fa. You can add all custom genes to this output.gtf as long as you follow the correct format and annotate it as exon. You can also add gtf lines to the non-filtered gtf file and filter it then. I prefer to generate a species reference for myself and the lab, and modify that one for my own use. Jul 26 '19 at 16:30
• Hi Mack, much appreciated for your help. And after making reference, it comes the error as below: " Property 'transcript_id' not found in GTF line 1704071: GFP AddedGene exon 1 846 . + 1 gene_id “GFP"; transcript_id “GFP"; gene_name “GFP"; transcript_name “GFP" "
– hua
Jul 26 '19 at 18:17
• I am sorry for that. I believe I had a copy/paste error that adjusted the quotes. Make sure your quotes around the "GFP" are correct in your gtf line. That should solve the problem but feel free to reach out if not. Also make sure each column is tab separated. Jul 26 '19 at 20:56
• Hi Mack, thank you for your advice. Finally, I make it. And I have another question want to ask you whether it is possible that I can add a truncate sequence into the customer reference? The information is as below: 1. We use Cre/loxp system. 2. The truncate we want to add into customer reference is Nkx2-5. Which was excised of exon2 and the flanking sequences resulted in a truncated RNA molecule that lacks exon 2 coding sequences, the splice sites, and the 3' noncoding region, rendering it essentially nonfunctional.
– hua
Jul 28 '19 at 16:35

Update your gtf file, update the genome fasta, run cellranger mkref.

• This looks like a comment. Or at least I don't understand how this helps to add a new gene. Could you expand it so that it is more clear ?
– llrs
Jul 26 '19 at 13:49
• Although this might be a valid answer, I find somehow dissatisfactory. I think some explanation would improve it a lot. Jul 28 '19 at 20:05