bankDensityProfile {GeneR}R Documentation

Computes density profile(s) of a bank of fasta sequences

Description

Computes profile(s) of user defined quantities from the begining or the end of sequence fragments.

Profile(s) is(are) constituted of bins of equal size with the mean, the standard deviation and the number of valid events for each bin.

Usage

bankDensityProfile (file, seqno=0, fun=seqSkew, fileout= NULL, nbin,
                    sizeBin, allSeq=FALSE, fromEnd=FALSE, name = "all",
                    threshold=0, strand=getStrand(),accu=FALSE,case="all")

Arguments

file

Integer/scalar, File name of the bank (fasta file)

seqno

Integer/scalar, Sequence number (buffer number)

strand

Integer/scalar, Strand (forward: 0, reverse: 1)

fun

Function, Function to be used (for example seqSkew

fileout

String/scalar, If not NULL, a file to write results

nbin

Integer/scalar, Number of bins to be created before the origin

sizeBin

Integer/scalar, Size of the bins

allSeq

Logical/scalar, If TRUE, Imput sequence is the whole sequence, if FALSE, input is only the half sequence

fromEnd

Logical/scalar, TRUE: Origin is the end of each sequence, if FALSE: Origin is the begining of each sequence

name

String/vector, Names of sequences in bank file, "all": uses all sequences of the bank

threshold

Integer/scalar, For each bin, maximum number of N tolerated in the sequence to participate to the computation

case

String/scalar, Case of the letters taken into account ("all", "upper", "lower")

accu

Flag, if true, returns sum , sum of square, and count on demanding function; else returns, mean and standard error on mean.

Value

a list of matrices, with the mean(s), the standard deviation(s) and the number of valid sub-fragments in each bin.

Author(s)

Emna Marrakchi and Antoine Lucas

See Also

densityProfile,bankSummary,GCcontent,seqSkew

Examples


  ## We create 2 banks
  for(i in 1:10)
  {
    s=randomSeq(n=100)
    placeString(s,seqno=0)
    writeFasta("toto_norm.fa",append=TRUE,name=i)

    s=randomSeq(prob=c(0.3,1,1,1,0)/3.3,n=100)
    placeString(s,seqno=0)
    writeFasta("toto_lowT.fa",append=TRUE,name=i)
  }


  densNorm <- bankDensityProfile("toto_norm.fa",nbin=10,sizeBin=10,allSeq=TRUE)
  densLowT <- bankDensityProfile("toto_lowT.fa",nbin=10,sizeBin=10,allSeq=TRUE)


  par(mfrow=c(1,2))
  ## Plot skew in normal bank
  plot(densNorm$skta,main="TA skew Normal bank",ylim=c(-0.8,0.3))

  ## Plot skew in low T bank
  plot(densLowT$skta,main="TA skew low T bank",ylim=c(-0.8,0.3))

  ## Show numbers
  densLowT

[Package GeneR version 2.24.0 Index]