Git Product home page Git Product logo

Comments (4)

thackl avatar thackl commented on September 26, 2024

Hi Alexandre,

you are on the right track. Two ways to do this.

  1. You can add columns start and end to your all_seqs.
all_seqs <- mutate(start=c(50000,500000,1000000, ...), end=c(110000,560000,1060000, ...)
  1. You can provide a table with locus coordinates for all your sequences (contigs) to focus.

You can use focus for this like this:

loci <- tribble(
~seq_id, ~start, ~end,
"genome1", 50000, 110000, # probably more realistic would be genomeA_contig1 or so
"genome2", 500000,  560000,
# ...
)

gggenomes(...) |> focus(.loci=loci)

Hope that helps

from gggenomes.

LemoAlex avatar LemoAlex commented on September 26, 2024

Thank you for the answer!

I did try the first method, because the second one, with many genes in the region, might be too tedious.

So:

all_seqs <- mutate(start=c(50000,500000,1000000, ...), end=c(110000,560000,1060000, ...)

But I get the error message

Error in UseMethod("mutate") : 
  no applicable method for 'mutate' applied to an object of class "c('double', 'numeric')"

When I look at my all_seqs file, it looks like this:

file_id seq_id seq_desc length

1 6genomes g1 NA 3836532
2 6genomes g2 NA 3937483
3 6genomes g3 NA 3750370
4 6genomes g4 NA 3995103
5 6genomes g5 NA 4006609
6 6genomes g6 NA 3980852

I thought about cutting the fasta files directly and loading only the fractions of the genomes I am interested in, but I am afraid it will then be messy to format the gff files according to the positions.

Cheers,

Alexandre

from gggenomes.

LemoAlex avatar LemoAlex commented on September 26, 2024

Hello again,

Sorry for the previous post, I fixed the issue by simply changing the line to:

all_seqs %>% mutate(start=c(50000,500000,1000000, ...), end=c(110000,560000,1060000, ...)

and it worked as I now have two extra columns in the all_seqs object.

However, how can I tell gggenomes to now only plot those regions rather than the entire genome ?

Cheers,

Alexandre

from gggenomes.

thackl avatar thackl commented on September 26, 2024

You need to give all_seqs with added start,end as seqs to gggenomes.

all_seqs_<-read_seqs('6genomes.fa',.id='file_id')
all_genomes_genes <- read_gff("genomes.gff") 

plot1 <- gggenomes(seq=A118_seqs, A118_genes)
plot1

all_loci <- all_seqs %>% mutate(start=c(50000,500000,1000000, ...), end=c(110000,560000,1060000, ...)

plot2 <- gggenomes(seq=all_loci,  all_genes)
plot2

from gggenomes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.