I'm trying to use the analyzeFeatures function in SGSeq following the vignette, but I get this error:
> library(SGSeq)
> library(TxDb.Hsapiens.UCSC.hg19.knownGene)
> sgfc <- analyzeFeaturesbam.info, which = gr)
Predict features...
Error in mergeTxFeatures(list_features, min_n_sample = min_n_sample) :
... must be one or more TxFeatures or a single
list of TxFeatures
The bam.info object contains information about my BAM files, after running getBamInfo():
> bam.info
sample_name file_bam paired_end read_length frag_length lib_size
1 sample1 /home/projects/gene_expression/Tmp/A549.cytosol.polyA.bam TRUE 101 262 126299548
2 sample2 /home/projects/gene_expression/Tmp/A549.nucleus.polyA.bam TRUE 101 293 149162537
6 sample3 /home/projects/gene_expression/Tmp/GM12878.cytosol.polyA.bam TRUE 76 276 62103999
7 sample4 /home/projects/gene_expression/Tmp/GM12878.nucleus.polyA.bam TRUE 76 239 60730206
These files have been merged from two separate bam files, processed with RSEM and TopHat. It includes transcripts from UCSC (hg19), but also some from other sources.
When I did into the functions a bit, the problem seems to occur with predictTxFeaturesPerSample. If I run that directly on a single sample, I get:
> sample_info <- bam.info
> i <- 1
> SGSeq:::predictTxFeaturesPerSample(file_bam = sample_info$file_bam[i],
+ paired_end = sample_info$paired_end[i], read_length = sample_info$read_length[i],
+ frag_length = sample_info$frag_length[i], lib_size = sample_info$lib_size[i], which=gr, alpha = 2, psi = 0, beta = 0.2,
+ gamma = 0.2)
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘mcols’ for signature ‘"character"’
Does SGSeq simply not work for samples that have been mapped using annotation that only partly overlaps with the USCS data?
~~Helen
Peharps you could try extracting the reads in the BAM file you have and then realign to a reference genome. Googling for "realign reads bam file" will turn up several hits around that theme that you might be able to try.