Hi there,
Excellent package! I am using it to do RNA-seq. But I encountered a small problem when using featureCounts(). The code is as follows:
featureCounts(
"A1.raw_1.fastq.gz.subjunc.BAM",
annot.inbuilt = NULL,
annot.ext = "GCF_015227675.2_mRatBN7.2_genomic.gtf",
isGTFAnnotationFile=TRUE,
isPairedEnd=TRUE,
nthreads = 8
)
And it returns this:
========== _____ _ _ ____ _____ ______ _____
===== / ____| | | | _ \| __ \| ____| /\ | __ \
===== | (___ | | | | |_) | |__) | |__ / \ | | | |
==== \___ \| | | | _ <| _ /| __| / /\ \ | | | |
==== ____) | |__| | |_) | | \ \| |____ / ____ \| |__| |
========== |_____/ \____/|____/|_| \_\______/_/ \_\_____/
Rsubread 2.8.0
//========================== featureCounts setting ===========================\\
|| ||
|| Input files : 1 BAM file ||
|| ||
|| A1.raw_1.fastq.gz.subjunc.BAM ||
|| ||
|| Paired-end : yes ||
|| Count read pairs : yes ||
|| Annotation : GCF_015227675.2_mRatBN7.2_genomic.gtf (GTF) ||
|| Dir for temp files : . ||
|| Threads : 8 ||
|| Level : meta-feature level ||
|| Multimapping reads : counted ||
|| Multi-overlapping reads : not counted ||
|| Min overlapping bases : 1 ||
|| ||
\\============================================================================//
//================================= Running ==================================\\
|| ||
|| Load annotation file GCF_015227675.2_mRatBN7.2_genomic.gtf ... ||
|| Features : 1144963 ||
|| Meta-features : 34322 ||
|| Chromosomes/contigs : 80 ||
|| ||
|| Process BAM file A1.raw_1.fastq.gz.subjunc.BAM... ||
|| Paired-end reads are included. ||
|| Total alignments : 41444160 ||
|| Successfully assigned alignments : 33409266 (80.6%) ||
|| Running time : 0.89 minutes ||
|| ||
|| Write the final count table. ||
|| Write the read assignment summary. ||
|| ||
\\============================================================================//
ERROR while rich displaying an object: Error in paste(capture.output(print(obj)), collapse = "\n"): result would exceed 2^31-1 bytes
Traceback:
1. FUN(X[[i]], ...)
2. tryCatch(withCallingHandlers({
. if (!mime %in% names(repr::mime2repr))
. stop("No repr_* for mimetype ", mime, " in repr::mime2repr")
. rpr <- repr::mime2repr[[mime]](obj)
. if (is.null(rpr))
. return(NULL)
. prepare_content(is.raw(rpr), rpr)
. }, error = error_handler), error = outer_handler)
3. tryCatchList(expr, classes, parentenv, handlers)
4. tryCatchOne(expr, names, parentenv, handlers[[1L]])
5. doTryCatch(return(expr), name, parentenv, handler)
6. withCallingHandlers({
. if (!mime %in% names(repr::mime2repr))
. stop("No repr_* for mimetype ", mime, " in repr::mime2repr")
. rpr <- repr::mime2repr[[mime]](obj)
. if (is.null(rpr))
. return(NULL)
. prepare_content(is.raw(rpr), rpr)
. }, error = error_handler)
7. repr::mime2repr[[mime]](obj)
8. repr_text.default(obj)
9. paste(capture.output(print(obj)), collapse = "\n")
It's my first time doing RNA-seq, and I really appreciate your help. Thank you.
Hi James,
Thank you so much for your advice! it worked perfectly after capturing the output to a new object.
Can I ask another question? I am stuck on how to input multiple files to
featureCounts()
orsubjunc()
. If I write this code:it will return this:
Thank you again for your kind help.
Your R command seems correct, although
featureCounts
by default expects the GTF file to contain at least one line of "exon" annotation (i.e. the value in the 3rd column in the GTF file isexon
). It also expects to see thegene_id
tag in the key-value pairs of theexon
lines. If your GTF file does not satisfy these conditions,featureCounts
will report this error message. If you want to use a GTF file that contains no exons but other types of annotations, you may use theGTF.featureType
option offeatureCounts
to specify the type you want (i.e. the wanted value in the 3rd column). Or, if your GTF file does not havegene_id
tags, you may use theGTF.attrType
option to specify the name of tag that you want to use as the name of features (e.g.gene_name
).Here is an example of a line of GTF annotation that
featureCounts
by default accepts (from Ensembl). It is anexon
annotation and has agene_id
tag.Hi Yang,
Thank you so much for your reply. The GTF file is downloaded from NCBI. And it contains other tags like
gene
andtranscript
along withexon
. The first a few lines are posted below:Can I use
GTF.featureType = "exon"
for this GTF file?And if I only enter one filename in the
files
, it will work out successfully.But if I enter more than one filename in the
files
, it will encounter a problem.I think I must enter the filenames in the wrong way. I really appreciate it if you can give me some advice on how to enter multiple filenames in the
files
.Thank you again for your kind reply.
The GTF seems to be OK, but in R, the unnamed parameters are given to the 1st, 2nd, 3rd, ... options of the function. For running the
featureCounts
function with multiple input BAM files, you need to put them in a vector as the first parameter:Otherwise featureCounts will treat the second file name as the second parameter.
Hi Yang,
Thank you so much for answering such a basic question for me. It worked perfectly.