This is awesome. Thank you and it worked like a charm!
Hi,
Is there a tool to create a fasta file using the long gene length sequence (i.e., TSE to TSS) that includes all the genomic elements, including 5' UTR, exons, introns 3'UTR from hg38? And then create a new gtf file using the fasta file subset and original gtf file information?
Thank you!
2 answers
Transcript level and gene level is the same when you have only one isoform. If you have several isoforms you may filter them to keep the longest with agat, or merge locations with bedtools intersect
Hi, You can use bedtools' getfasta function to extract a sequence from a fasta file, creating a new fasta. Since you work with human, you should have the complete fasta and gene information at hand. Just create a bed file (I guess gtf works as well) with only start and end of your long gene.
bedtools getfasta -fi hg36.fasta -bed myGene.bed -fo myGene.fasta
Then take the original gtf and reduce all coordinates by the one from your bed file (check for 0-based vs. 1-based coordinates in bed vs. gtf ). Adjust the contig name if necessary and load everything into IGV and check if it fits.
Thank you! This is very helpful.
Log in to answer this question.