Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GC content function for plot. #151

Open
wants to merge 369 commits into
base: improve-pkgdown-code-chunk-label
Choose a base branch
from

Conversation

yzhong005
Copy link

@yzhong005 yzhong005 commented Jun 1, 2023

add a function to manually generate the GC content data.frame, which can easily add into the plot.

require(Biostrings)
gc_content<-function (x, seq_id, window)
{#x must be a DNAstrings, can take with readDNAstring, cannot be a DNAstringset
start<-seq(0,(length(x)-window),window)
pick<-function(start){
a<-x[start:(start+window)]
return(a)
}
set<-lapply(start,pick)
gc_test<-rowSums(letterFrequency(DNAStringSet(set), c("G", "C")))/window
gc_test<-data.frame(seq_id=seq_id,start=start,end=start+window,score=gc_test)
return(gc_test)}

an example

seq<-readDNAstring("AA.fasta")
gc<-gc_content(seq, seq_id="a",50)
gggenomes(genes,seqs=seqs,links = links,feats=gc)+
geom_seq()+
geom_gene()+
geom_link(offset = 0.1)+
geom_wiggle(aes(z=score))

thackl and others added 30 commits February 2, 2021 19:58
various smaller fixes and improvements
improve smart-read backend with new mapping of defined formats, extensions, context and parsers
make genes the first arguement of gggenomes for more intuitive usage. gggenomes() also reads files now
Made it possible to focus on several regions from the same parent sequence at once
Added locate - like focus, but add loci as track instead of zoom; added position_* examples
iimog and others added 30 commits June 6, 2024 14:43
quotes are for package names only
Instances found using checkhelper::find_missing_tags()
Automatic formatting applied
Co-authored-by: x <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants