Originally posted by super0925
View Post
Seqanswers Leaderboard Ad
Collapse
Announcement
Collapse
No announcement yet.
X
-
Originally posted by dpryan View PostGTF files match the "top assembly", rather than the "primary assembly". Either download the matching fasta file or remove the haplotype patches from your GTF.
The genes.gtf and genome.fa are downloaded from the latest UCSC homo sapiens hg19 genome.
How could I 'download the matching fasta' or 'remove the haplotype patches' to use your script?
Thank you!
PS: I only change your script to
GTF <- import.gff(GTFfile, format="gtf", genome="hg19", asRangedData=F, feature.type="exon")
grl <- reduce(split(GTF, elementMetadata(GTF)$gene_id))
reducedGTF <- unlist(grl, use.names=T)
Comment
-
If you just need the lengths then remove the code that calculates GC content. Something like the following should work:
Code:#!/usr/bin/Rscript library(GenomicRanges) library(rtracklayer) library(Rsamtools) GTFfile = "something.GTF" #Load the annotation and reduce it GTF <- import.gff(GTFfile, format="gtf", genome="GRCm38.71", asRangedData=F, feature.type="exon") grl <- reduce(split(GTF, elementMetadata(GTF)$gene_id)) reducedGTF <- unlist(grl, use.names=T) elementMetadata(reducedGTF)$gene_id <- rep(names(grl), elementLengths(grl)) elementMetadata(reducedGTF)$widths <- width(reducedGTF) #Create a list of the ensembl_id/GC calc_GC_length <- function(x) { sum(elementMetadata(x)$widths) } output <- sapply(split(reducedGTF, elementMetadata(reducedGTF)$gene_id), calc_GC_length)
Comment
-
Originally posted by dpryan View PostIf you just need the lengths then remove the code that calculates GC content. Something like the following should work:
Code:#!/usr/bin/Rscript library(GenomicRanges) library(rtracklayer) library(Rsamtools) GTFfile = "something.GTF" #Load the annotation and reduce it GTF <- import.gff(GTFfile, format="gtf", genome="GRCm38.71", asRangedData=F, feature.type="exon") grl <- reduce(split(GTF, elementMetadata(GTF)$gene_id)) reducedGTF <- unlist(grl, use.names=T) elementMetadata(reducedGTF)$gene_id <- rep(names(grl), elementLengths(grl)) elementMetadata(reducedGTF)$widths <- width(reducedGTF) #Create a list of the ensembl_id/GC calc_GC_length <- function(x) { sum(elementMetadata(x)$widths) } output <- sapply(split(reducedGTF, elementMetadata(reducedGTF)$gene_id), calc_GC_length)
Hi D
Brilliant! It works.
I have just changed one command
GTF <- import.gff(GTFfile, format="gtf", genome="hg19", asRangedData=F, feature.type="exon")
However, the result only contain 25369 genes.
However, there are 23170 rows in the count table generated by HTseq, which means there are 23170 genes in the human genome.
Why does the dimension are different? I don't think rpkm() could go further if the dimension are different...
Thank you!
Comment
-
There are some entries that htseq-count will skip (those without exons?), which presumably is why this happens. Anyway, you need to ensure that everything is in the same order anyway, so make sure to write meaningful row names and use those with match().
Comment
-
Originally posted by dpryan View PostThere are some entries that htseq-count will skip (those without exons?), which presumably is why this happens. Anyway, you need to ensure that everything is in the same order anyway, so make sure to write meaningful row names and use those with match().
And I also found Cufflinks could calculate RPKM directly.
by
cufflinks -o OutDir -g hg19/genes.gtf TopHat/accepted_hits.bam
Comment
Latest Articles
Collapse
-
by seqadmin
The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...-
Channel: Articles
04-22-2024, 07:01 AM -
-
by seqadmin
Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...-
Channel: Articles
04-04-2024, 04:25 PM -
ad_right_rmr
Collapse
News
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, 05-02-2024, 08:06 AM
|
0 responses
16 views
0 likes
|
Last Post
by seqadmin
05-02-2024, 08:06 AM
|
||
Started by seqadmin, 04-30-2024, 12:17 PM
|
0 responses
20 views
0 likes
|
Last Post
by seqadmin
04-30-2024, 12:17 PM
|
||
Started by seqadmin, 04-29-2024, 10:49 AM
|
0 responses
25 views
0 likes
|
Last Post
by seqadmin
04-29-2024, 10:49 AM
|
||
Started by seqadmin, 04-25-2024, 11:49 AM
|
0 responses
28 views
0 likes
|
Last Post
by seqadmin
04-25-2024, 11:49 AM
|
Comment