fai_query2: Extract a part of a FASTA sequence.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/fai.R

Description

Return a part of a FASTA sequence.

Usage

1
2
fai_query2( faifh, regionstring )
fai_query3( faifh, regionstring , resultstring )

Arguments

faifh

FAIhandle as returned by fai_open

regionstring

String of the form sequencename:beginpos-endpos e.g. "MTRR1mouse:20-40" specifying the sequence and region

resultstring

String variable to store results into

Details

Note: the fai_query3 and fai_query5 methods are DEPRECATED : to be as fast as possible, they modified a given variable's contents (resultstring) which will cause issues in R's internals!

Use .Call("FAI_query2", faifh, regionstring ) to eliminate the overhead of using the R wrapper function. Use this function in combination with a while( ( seq = fai_query2(F,region) ) != FALSE ) if you need to loop. Only the string "FALSE" has a boolean value of FALSE, all others have a boolean value of TRUE.

Value

A string containing the (sub-)sequence, FALSE if it fails.

Author(s)

Ulrich Wittelsbuerger

See Also

fai_open

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
##
##	Example :
##
faifile  <- system.file("extdata", "ex.fasta", package = "WhopGenome")
faifh <- fai_open( faifile )
stopifnot( !is.null(faifh) )
result = fai_query2( faifh , "1:100-200" )
if( result != FALSE )
{
	print( result )
}
fai_close( faifh )

WhopGenome documentation built on May 1, 2019, 10:12 p.m.