\name{posMaskedSeq}
\alias{posMaskedSeqFile}
\alias{posMaskedSeq}

\title{Position of masked fragments}
\description{
  These functions return the position of masked fragments within a sequence.
  Masked fragments are identified by lower case letters or by specific characters (for
  example: 'N').  
}
\usage{
posMaskedSeq(seqno=0,from = 1, to = 0, max = 10000,type= "lower")
posMaskedSeqFile(file, name = NA, from = 1, to = 0, max = 10000)
}

\arguments{
  \item{seqno}{Integer/scalar, Sequence number (buffer number)}
  \item{from,to}{Integer/vector, Absolute addresses of the begin and the end of the fragments,
  (1 means the first nucleotide and 0 conventionally the last one; from must not be larger than to)}
  \item{file}{String/scalar, Path and file name of the Fasta sequence bank}
  \item{name}{Name of the sequence (if NA: the first sequence of the bank)}
  \item{type}{type of masked nucleotide i.e. "lower" or any character like "N" 
  (if lower, posMaskedSeq looks for lower case letters; if a character,
   posMaskedSeq looks for this character}
  \item{max}{Maximum number of fragments to retrieve (default: 10000)}
}
%\details{ 
% }

\value{
  a matrix of size n,2.

  gives a warning if there is more than max regions.

  return numeric(0) when no regions found.
}

\note{This function returns by default only 10000 first
  regions (default parameter max).}

\seealso{See also \code{\link{mask}},  \code{\link{upperSeq}},  \code{\link{lowerSeq}}}

\author{Odile Rogier and Antoine Lucas}


\examples{
## Make a dummy sequence
s <- "ATGCtgTGTTagtacATNNNNNNNNNNNNNNNTGGGTTTaAAAattt"
placeString(s,upper=FALSE,seqno=0)
posMaskedSeq(seqno=0,type="upper")
posMaskedSeq(seqno=0,type="lower")

\dontrun{
posMaskedSeq(seqno=0,type="lower",max=2)
}
posMaskedSeq(seqno=0,type="N")


writeFasta(file="toto.fa")
posMaskedSeqFile("toto.fa")


}



\keyword{utilities}