The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

    BoutrosLab::TSVStream::Format::AnnovarInput::Role

SYNOPSIS

Collection of roles that implement AnnovarInput format capable objects. This role provides the common attributes for AnnovarInput format, but there are sub-roles to specify the various restrictions for the chr attribute.

DESCRIPTION

To create a new sub-role (<XXX>), extend the type categories in the BoutrosLab::TSVStream::Format::AnnovarInput::Types module to provide a type that restricts the chr field appropriately, and define a role module that applies that type to the chr attribute.

Look at the definition of the Human type in this role.

To use one of these roles to define an object XXX:

        package BoutrosLab::TSVStream::Format::AnnovarInput::<XXX>::Fixed;
        use Moose;

        with qw(
                BoutrosLab::TSVStream::Format::AnnovarInput::Role
                BoutrosLab::TSVStream::Format::AnnovarInput::Role::<XXX>
                BoutrosLab::TSVStream::IO::Role::Fixed
                );

(Replace 'Fixed' with 'Dyn' in the package name and in the 'with ... BoutrosLab::TSVStream::IO::Role::Fixed' if you want the object to have a group of dynamic fields in addition to the standard AnnovarInput attributes.)

See BoutrosLab::TSVStream::Format::Human::Fixed for an example.

Class Attributes

_fields

The _fields attribute is required by the IO roles to determine which fields are to be read or written. In this case, the fields are chr, start, end, ref, and alt, which are described as attributes below.

Attributes

chr

The chr attribute provides the name of the chromosome that is being specified. There are different names used for different species of organism; and for different ways of processing the same organism; so this attribute is provided in a separate role.

start

end

The start and end attributes are integers that provide the start and end position within the chromosome that is being described.

ref

alt

The ref and alt attributes describe amino acid sequences. They can either contain the string '-', or a sequence of acids ('A', 'C', 'G', and 'T' of at most 500 acids. (E.G.: CGATCGAT)

SUBROLES

BoutrosLab::TSVStream::Format::AnnovarInput::Role::Human

BoutrosLab::TSVStream::Format::AnnovarInput::Role::HumanNoChr

These two subroles provide a chr field that has no tag. It will accept valid chr values regardless of whether the provided value has a leading 'chr' or not; the value will get the 'chr' prefix inserted if missing (Human) or removed if present (HumanNoChr). So, you choose the type that you want to end with.

For a reader, this happens when reading an input stream - the leading 'chr' will get forced to exist or not based on the type you choose. So, within your program, the values will all appear in a consistant form regardless of what the input file provided.

For a writer, this happens upon write - the write method will accept either an object of the configured form (which it writes out directly), or an object of some other type (which it converts into the specified type before writing). So, you can have your program write into the format that is needed by whatever program is going to use the output, regardless of which format is used for internal computation by your program.

BoutrosLab::TSVStream::Format::AnnovarInput::Role::HumanTag

BoutrosLab::TSVStream::Format::AnnovarInput::Role::HumanTagNoChr

These two subroles provide a chr field that may have a tag. That allows a standard chr value to have an appended "_NAME" (anything following an underscore). It also allows the tag-only chr value "Un_NAME" (any NAME following 'Un_'.

Like the two subroles above, the addition or absense of 'NoChr' in the role name controls whether the value is coerced to have, or not have, a leading 'chr' string. (See the previous section.)

SEE ALSO

BoutrosLab::TSVStream::Format

This describes how IO-capable objects (such as ones created using a subrole of this role) are defined.

BoutrosLab::TSVStream::IO

This describes of how readers and writers convert objects to or from a text stream.

- BoutrosLab::TSVStream::Format::AnnovarInput::Human::Fixed
- BoutrosLab::TSVStream::Format::AnnovarInput::Human::Dyn
- BoutrosLab::TSVStream::Format::AnnovarInput::HumanNoChr::Fixed
- BoutrosLab::TSVStream::Format::AnnovarInput::HumanNoChr::Dyn

These are the four variants for the object specification for Human objects. Those are the modules that you will typically use in your program.

Human/HumanNoChr specifies whether objects will be converted if needed to (no) leading 'chr' prefix in the chr attribute.

Fixed/Dyn specifies whether only the standard fields are expected, or if a dynamic list of additional fields may occur.

AUTHOR

John Macdonald - Boutros Lab

ACKNOWLEDGEMENTS

Paul Boutros, Phd, PI - Boutros Lab

The Ontario Institute for Cancer Research