XStringViews-constructors     package:Biostrings     R Documentation

Basic functions for creating or modifying XStringViews objects

Description:

     A set of basic functions for creating or modifying XStringViews
     objects.

Usage:

       XStringViews(x, subjectClass, collapse="")

Arguments:

       x: An XString object or a character vector for 'XStringViews'. 

subjectClass: The class to be given to the subject of the XStringViews
          object created and returned by the function. Must be the name
          of one of the direct XString subclasses i.e. '"BString"',
          '"DNAString"', '"RNAString"' or '"AAString"'. 

collapse: An optional character string to be inserted between the views
          of the XStringViews object created and returned by the
          function. 

Details:

     The 'XStringViews' constructor will try to create an XStringViews
     object from the value passed to its 'x' argument. If 'x' itself is
     an XStringViews object, the returned object is obtained by
     coercing its subject to the class specified by 'subjectClass'. If
     'x' is an XString object, the returned object is made of a single
     view that starts at the first letter and ends at the last letter
     of 'x' (in addition 'x' itself is coerced to the class specified
     by 'subjectClass' when specified). If 'x' is a character vector,
     the returned object has one view per character string in 'x' (and
     its subject is an instance of the class specified by
     'subjectClass').

Value:

     An XStringViews object 'y'. 'length(y)' (the number of views in
     'y') is '1' when 'x' is an XString object and 'length(x)'
     otherwise.

See Also:

     XStringViews-class, XString-class

Examples:

       v12 <- Views(DNAString("TAATAATG"), start=-2:9, end=0:11)
       XStringViews(v12, subjectClass="RNAString")
       XStringViews(AAString("MARKSLEMSIR*"))
       XStringViews("abcdefghij", subjectClass="BString")

