Since I am using ClinVar, I do only have RefSeq accession numbers.
I can't use HTSlib because it is for C and I want to extend a bigger Java project.
Shouldn't a Variant have a reference to a unique transcript?
I want to run some algorithms on splice site mutations. This is what I have done (or at least tried) so far:
As I run my program I get an Exception from HTSJDK because there are multiple RefSeq entries with the same name:
Exception in thread "main" htsjdk.samtools.SAMException: Contig 'hg19_refGene_NM_001037501' already exists in fasta index.
in the following line of my code:
FastaSequenceIndex faIndex = new FastaSequenceIndex(new File("data/RefSeqSequencesGRCh37_NM.fa.fai"));
These RefSeq entries are on both strands (+ and -) and have different positions. The sequences show some differences in the sequences, too. But usually not far from each other on the same chromosome.
The Questions
Since I am using ClinVar, I do only have RefSeq accession numbers.
I can't use HTSlib because it is for C and I want to extend a bigger Java project.
Shouldn't a Variant have a reference to a unique transcript?
Ah, I had missed the Clinvar tag in your post. I have to admit that I'm not familiar enough with Clinvar to offer much guidance. Realistically, those variants were most likely originally mapped against the genome and then simply annotated with gene information. Whether those original genome mappings are on Clinvar or not I don't know, however.
BTW, since you presumably do need the sequence, the FAI files are actually pretty simple to parse and retrieve sequence from. I suspect that you'll have to write your own parser/sequence extractor that will allow iterating over all instances of a gene in the file and either report all unique sequences or all compatible sequences.
This is because the UCSC RefGene track is merely an alignment track of NCBI's known RefSeq dataset, not the genome placement of those records as is provided by NCBI. It is not at all surprising that close paralogs will have more than one alignment placement.
NCBI's placement of RefSeq transcripts is available as a GFF file: ftp://ftp.ncbi.nlm.nih.gov/genomes/refseq/vertebrate_mammalian/Homo_sapiens/reference/GCF_000001405.28_GRCh38.p2/GCF_000001405.28_GRCh38.p2_genomic.gff.gz
Genomic and transcript FASTA files are also available at this location. (Note an update is coming soon)
This looks very nice, but do you by any chance know about similar file with unspliced genes, not transcripts (I want introns, too)?
I haven't found anything so far. Looks like getting the whole hg19 (GRCh37 or GRCh38) (from UCSC) is the way to go.
I took the whole chromosome-wise GRCh37 as Reference chromFa.tar.gz from UCSC bigZips and RefGene-File to get the Transcripts positions and the Exons positions.
Edit: I found a similar question: Convert Nm_ Mrna Position Into Corresponding Grch37 Genomic Dna Position?
Log in to answer this question.