bamAlign: bamAlign

Description Usage Arguments Value Author(s) Examples

View source: R/rbamtools.R

Description

The function takes data stored in aling-fields and creates a bamAlign object, which can be stored in a BAM file via bamWriter.

Usage

1
2
bamAlign(qname,qseq,qqual,cigar,refid,position,flag=272L,alqual=10L,
                   mrefid=(-1L),mpos=(-1L),insertsize=0L)

Arguments

qname

Query name, e.g. "HWUSI..." for Illumina sequences.

qseq

Query sequence (DNA-sequence)

qqual

Query quality (ASCII coded quality values). Must contain same number of characters as qseq

cigar

CIGAR string. Must be in valid format, e.g. 45M100N56N. Sequence length must match encoded items in CIGAR string.

refid

Integer. 0-based index which must have a counterpart in Reference Sequence Dictionary (otherwise samtools crashed when creating a BAM-index file).

position

integer: Genomic start position of alignment.

flag

integer: Contains information about binary stored flags in align.

alqual

integer: Alignment quality.

mrefid

integer: Mate refid. Used for paired end reads.

mpos

integer: Mate position. Used for paired end reads.

insertsize

integer.

Value

bamGapList

Author(s)

Wolfgang Kaisers

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Create alignment object from scratch
align<-bamAlign("HWUSI-0001", "ATGTACGTCG", "Qual/Strng", "4M10N6M", 
            refid=0, position=100)

# Print and access data
align
name(align)
alignSeq(align)
alignQual(align)
cigarData(align)
refID(align)
position(align)

Example output

Loading required package: refGenome
Loading required package: doBy
Loading required package: RSQLite
Class       :    bamAlign
refId       :           0
Position    :         100

Cigar Data  :
  Length Type
0      4    M
1     10    N
2      6    M
[1] "HWUSI-0001"
[1] "ATGTACGTCG"
[1] "Qual/Strng"
  Length Type
0      4    M
1     10    N
2      6    M
[1] 0
[1] 100

rbamtools documentation built on Nov. 11, 2019, 5:09 p.m.