remap: Remap BAM file to a new reference genome

Description Usage Arguments Details Value See Also

View source: R/map.r

Description

This function will remap a bam file previously mapped by the Cellranger software to a new genome.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
remap(
  input,
  reference,
  annotation,
  outdir,
  fastqdir = NULL,
  refdir = NULL,
  countdir = NULL,
  id = NULL,
  nthreads = 4,
  chemistry = "auto",
  remake = FALSE,
  copy_bam = FALSE,
  copy_bar = FALSE,
  copy_h5 = FALSE
)

Arguments

input

a bam file previously mapped by the Cellranger software

reference

a reference genome fasta file (e.g., .fna)

annotation

a GTF (.gtf) annotation file associated with the reference genome

outdir

a directory where the output will be generated

fastqdir

optional a directory for the bamtofastq, see details

refdir

**optional a directory for the cellranger_mkref, see details

countdir

optional a directory for the cellranger_count, see details

id

optional an id that identifies the sample, this will be embedded in the read-groups (RG tag) of the header and reads of the bam-file. If not specified, it is derived from the input bam file

nthreads

optional a number of threads to run on

chemistry

optional a 10X chemistry, use only when the autodetection is failing

remake

optional remake the output if it already exists

copy_bam

optional a TRUE value or file path to a location where the re-mapped bam file will be copied

copy_bar

optional a TRUE value or file path to a location where the file with filtered barcodes will be copied

copy_h5

optional a TRUE value or file path to a location where the .h5 expression count matrix will be copied.

Details

The remap function calls the bamtofastq, cellranger_mkref and cellranger_count to convert the bam file into fastq files, create the cellranger reference genome and perform the expression analysis respectively. See the individual functions for details.

The optional directories fastqdir, refdir and countdir are for outputs from the above mentioned bamtofastq, cellranger_mkref and cellranger_count. If not specified, folders fastqdir, ref and count in the outdir directory are used. If these are undesired, a path to a non-existing directory or directory with a previously existing run must be used. For example when a multiple bam files are being re-mapped to the same reference, all of them would share the same refdir. See the bamtofastq, cellranger_mkref and cellranger_count for details.

Given the intended usage is to obtain a remapped bam file and a list of filtered barcodes, copy_bam and copy_bar parameters are provided. If TRUE, the bam file and barcodes are copied to the outdir folder as prefix.bam and prefix.barcodes.txt where prefix is the core of the input file (see corename). An arbitrary path can also be provided.

Value

a list of paths to the original or copied bam, barcodes and h5 files.

See Also

bamtofastq, cellranger_mkref and cellranger_count for details on the steps performed by the remap function.


bioDS/phyloRNA documentation built on Feb. 21, 2022, 3:28 p.m.