getIdeogramData: Import transgenic genome data from .bam or .fasta file

Description Usage Arguments Value See Also Examples

View source: R/gmoviz.R

Description

Read in the seqname, start & end from .bam or .fasta file and format correctly for plotting with gmoviz.

Usage

1
2
3
getIdeogramData(bam_file = NULL, fasta_file = NULL,
  fasta_folder = NULL, just_pattern = NULL, unwanted_chr = NULL,
  wanted_chr = NULL, add_chr = TRUE)

Arguments

bam_file, fasta_file, fasta_folder

Location of either a .bam file, .fasta file or folder of .fasta files to read in. You only need to supply one of these file types; .bam files are recommended because it is much faster than using .fasta files. Also note that the filters unwatedChr, wanted_chr and just_pattern won't work with single .fasta files (only with .bam or .fasta folders).

just_pattern

If supplied, this pattern (regex) will be used to select the sequences to read in

unwanted_chr

If supplied, these sequences won't be read in

wanted_chr

If supplied, only these sequences will be read in

add_chr

If TRUE, 'chr' will be added to the start of sequence names with one or two characters (e.g. X will become chrX and 10 will become chr10 but plasmid will remain as-is)

Value

A GRanges containing the ideogram data (sequence names, starts & ends).

See Also

The gmovizInitialise and featureDiagram functions which can be used to plot this data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## the example .bam file
path <- system.file('extdata', 'ex1.bam', package='Rsamtools')

## just starting with 'seq'
getIdeogramData(bam_file=path, just_pattern='^seq')

## only seq1
getIdeogramData(bam_file=path, wanted_chr='seq1')

## not seq2 (same as above)
getIdeogramData(bam_file=path, unwanted_chr='seq2')

## you can mix and match any of the filters
getIdeogramData(bam_file=path, unwanted_chr='seq2', just_pattern='^seq')

## the function also works to read in individual .fasta files, but please
## note that for now the filters won't work (so if you have multiple
## sequences in one .fasta file then they will all be read in)
path <- system.file('extdata', 'someORF.fa', package='Biostrings')
getIdeogramData(fasta_file=path)

## we can also read in selected .fasta files from a folder of .fasta files,
## based on the filters shown above for the .bam file
path <- system.file('extdata', 'fastaFolder', package='gmoviz')
getIdeogramData(fasta_folder=path)

gmoviz documentation built on Nov. 8, 2020, 5:41 p.m.