Description Usage Arguments Details Author(s) Examples
The function takes an opened instance of bamReader
,
a prefix for the output file and produces a sorted BAM file which is
(apart from being sorted) identical to the input file.
BAM-files must be sorted before an index can be created.
During this routine, some content of the source file is copied into the
working memory, sorted and written into temporary files.
Finally, the sorted files are merged into a single target.
The name of the sorted BAM-file will be [prefix].bam.
Number and size of temporary files depend on source file size and used
working memory (maxmem).
Small maxmem values result in large numbers of temporary files.
The minimum maxmem value is 100000000. Smaller maxmem values cause an error.
1 2 |
object |
|
prefix |
The prefix of the output file. When 'sorted' is given as prefix, the routine produces a file named 'sorted.bam'. |
byName |
(Optional) Logical. Must have length 1. When TRUE the file will be sorted by align name. When FALSE the file will be sorted by coordinate. Sorting by coordinate is the prerequisite for creation of an index file. |
maxmem |
(Optional) Numeric. Must have length 1. Minimum value is 100000000. Smaller maxmem values cause an error. Determines how many aligns are sorted inside the working memory before they are written into a temporary file. |
path |
|
The function does not take a complete name for the output file but only a prefix. The prefix is internally completed with a '.bam' suffix. This is because the samtools function 'bam_sort_core_ext' only takes a prefix. samtools in turn produces intermediate files which also use the prefix and which are removed again when the 'bam_sort_core_ext' cleans up.
Wolfgang Kaisers
1 2 3 4 5 6 7 | bam<-system.file("extdata","accepted_hits.bam",package="rbamtools")
reader<-bamReader(bam)
bamSort(reader)
## - - - - - - - - - - - - - - - - - ##
## sampleBamFiles
## - - - - - - - - - - - - - - - - - ##
bs <- sampleBamFiles(bam)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.