PoisonAlien / trackplot

Generate IGV style locus tracks from bigWig files in R
133 stars 16 forks source link

Error loading custom genome and gtf files #26

Closed PeterMulhair closed 11 months ago

PeterMulhair commented 11 months ago

Hi,

Thanks for this great package!

I'm trying to create a plot using custom genome and gtf file and not fully sure how it works with the new version of trackplot.

My code:

source("https://github.com/PoisonAlien/trackplot/blob/master/R/trackplot.R?raw=true")

bigWigs = c("BomMajo_genome_cov_chrm_sorted.bw")
bigWigs = read_coldata(bws = bigWigs, build = "GCA_932526495.1_idBomMajo1.1_genomic.fasta")
track_data = track_extract(colData = bigWigs, loci = "4:34275000-34300000", gtf = "Bombylius_major-GCA_932526495.1-2022_07-genes.pt.gtf")

I get an error when loading the gtf file:

Checking for files..
Input type: bw
Ref genome: GCA_932526495.1_idBomMajo1.1_genomic.fasta
OK!
Parsing loci..
    Queried region: 4:34275000-34300000 [25000 bps]
Parsing gtf file..
Error in .parse_gtf(gtf = gtf, chr = chr, start = start, end = end) : 
  could not find function "is"
Calls: track_extract -> .parse_gtf
Execution halted
  1. Is the above code the correct way to use the tool with custom data?
  2. The error could not find function "is" seems quite trivial, is this an issue with R? I'm running R version 3.2.3

I can provide my data if needed.

Any help appreciated!

Peter

PoisonAlien commented 11 months ago

Hi,

  1. Yes, you are using it correctly. I just checked it on my example data and it works fine.
  2. Could you please check ?is if it exists in your R version?

If you still have the same issue, please share the GTF file so I can look.

EDIT: function is exists in R 3.0.0 so I don't think it's the issue here.

PeterMulhair commented 11 months ago

Hi,

Thanks for following up on this so quickly, and confirming code usage with custom data.

is function indeed exists in my version of R.

However, when I run the trackplot code within a script using Rscript I get the is error, but when I run it within an R session it finishes without any errors! So likely an issue on my side, your code works perfectly!

Thanks again for your help with this.

Peter