class Google::Apis::GenomicsV1beta2::Read

A read alignment describes a linear alignment of a string of DNA to a reference sequence, in addition to metadata about the fragment (the molecule of DNA sequenced) and the read (the bases which were read by the sequencer). A read is equivalent to a line in a SAM file. A read belongs to exactly one read group and exactly one read group set. Generating a reference-aligned sequence string When interacting with mapped reads, it's often useful to produce a string representing the local alignment of the read to reference. The following pseudocode demonstrates one way of doing this: out = “” offset = 0 for c in read.alignment.cigar ` switch c.operation ` case “ ALIGNMENT_MATCH”, “SEQUENCE_MATCH”, “SEQUENCE_MISMATCH”: out += read. alignedSequence offset += c.operationLength break case “CLIP_SOFT”, “INSERT”: offset += c.operationLength break case “PAD”: out += repeat(“*”, c.operationLength) break case “DELETE”: out += repeat(“-”, c.operationLength) break case “SKIP”: out += repeat(“ ”, c.operationLength) break case “CLIP_HARD”: break ` ` return out Converting to SAM's CIGAR string The following pseudocode generates a SAM CIGAR string from the cigar field. Note that this is a lossy conversion (cigar. referenceSequence is lost). cigarMap = ` “ALIGNMENT_MATCH”: “M”, “INSERT”: “I”, “DELETE”: “D”, “SKIP”: “N”, “CLIP_SOFT”: “S”, “CLIP_HARD”: “H”, “PAD”: “P”, “SEQUENCE_MATCH”: “=”, “ SEQUENCE_MISMATCH”: “X”, ` cigarStr = “” for c in read.alignment.cigar ` cigarStr += c.operationLength + cigarMap ` return cigarStr

Attributes

aligned_quality[RW]

The quality of the read sequence contained in this alignment record. alignedSequence and alignedQuality may be shorter than the full read sequence and quality. This will occur if the alignment is part of a chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR for this read will begin/end with a hard clip operator that will indicate the length of the excised sequence. Corresponds to the JSON property `alignedQuality` @return [Array<Fixnum>]

aligned_sequence[RW]

The bases of the read sequence contained in this alignment record, without CIGAR operations applied. alignedSequence and alignedQuality may be shorter than the full read sequence and quality. This will occur if the alignment is part of a chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR for this read will begin/end with a hard clip operator that will indicate the length of the excised sequence. Corresponds to the JSON property `alignedSequence` @return [String]

alignment[RW]

A linear alignment can be represented by one CIGAR string. Describes the mapped position and local alignment of the read to the reference. Corresponds to the JSON property `alignment` @return [Google::Apis::GenomicsV1beta2::LinearAlignment]

duplicate_fragment[RW]

The fragment is a PCR or optical duplicate (SAM flag 0x400) Corresponds to the JSON property `duplicateFragment` @return [Boolean]

duplicate_fragment?[RW]

The fragment is a PCR or optical duplicate (SAM flag 0x400) Corresponds to the JSON property `duplicateFragment` @return [Boolean]

failed_vendor_quality_checks[RW]

SAM flag 0x200 Corresponds to the JSON property `failedVendorQualityChecks` @return [Boolean]

failed_vendor_quality_checks?[RW]

SAM flag 0x200 Corresponds to the JSON property `failedVendorQualityChecks` @return [Boolean]

fragment_length[RW]

The observed length of the fragment, equivalent to TLEN in SAM. Corresponds to the JSON property `fragmentLength` @return [Fixnum]

fragment_name[RW]

The fragment name. Equivalent to QNAME (query template name) in SAM. Corresponds to the JSON property `fragmentName` @return [String]

id[RW]

The unique ID for this read. This is a generated unique ID, not to be confused with fragmentName. Corresponds to the JSON property `id` @return [String]

info[RW]

A string which maps to an array of values. Corresponds to the JSON property `info` @return [Hash<String,Array<String>>]

next_mate_position[RW]

An abstraction for referring to a genomic position, in relation to some already known reference. For now, represents a genomic position as a reference name, a base number on that reference (0-based), and a determination of forward or reverse strand. Corresponds to the JSON property `nextMatePosition` @return [Google::Apis::GenomicsV1beta2::Position]

number_reads[RW]

The number of reads in the fragment (extension to SAM flag 0x1). Corresponds to the JSON property `numberReads` @return [Fixnum]

proper_placement[RW]

The orientation and the distance between reads from the fragment are consistent with the sequencing protocol (SAM flag 0x2) Corresponds to the JSON property `properPlacement` @return [Boolean]

proper_placement?[RW]

The orientation and the distance between reads from the fragment are consistent with the sequencing protocol (SAM flag 0x2) Corresponds to the JSON property `properPlacement` @return [Boolean]

read_group_id[RW]

The ID of the read group this read belongs to. (Every read must belong to exactly one read group.) Corresponds to the JSON property `readGroupId` @return [String]

read_group_set_id[RW]

The ID of the read group set this read belongs to. (Every read must belong to exactly one read group set.) Corresponds to the JSON property `readGroupSetId` @return [String]

read_number[RW]

The read number in sequencing. 0-based and less than numberReads. This field replaces SAM flag 0x40 and 0x80. Corresponds to the JSON property `readNumber` @return [Fixnum]

secondary_alignment[RW]

Whether this alignment is secondary. Equivalent to SAM flag 0x100. A secondary alignment represents an alternative to the primary alignment for this read. Aligners may return secondary alignments if a read can map ambiguously to multiple coordinates in the genome. By convention, each read has one and only one alignment where both secondaryAlignment and supplementaryAlignment are false. Corresponds to the JSON property `secondaryAlignment` @return [Boolean]

secondary_alignment?[RW]

Whether this alignment is secondary. Equivalent to SAM flag 0x100. A secondary alignment represents an alternative to the primary alignment for this read. Aligners may return secondary alignments if a read can map ambiguously to multiple coordinates in the genome. By convention, each read has one and only one alignment where both secondaryAlignment and supplementaryAlignment are false. Corresponds to the JSON property `secondaryAlignment` @return [Boolean]

supplementary_alignment[RW]

Whether this alignment is supplementary. Equivalent to SAM flag 0x800. Supplementary alignments are used in the representation of a chimeric alignment. In a chimeric alignment, a read is split into multiple linear alignments that map to different reference contigs. The first linear alignment in the read will be designated as the representative alignment; the remaining linear alignments will be designated as supplementary alignments. These alignments may have different mapping quality scores. In each linear alignment in a chimeric alignment, the read will be hard clipped. The alignedSequence and alignedQuality fields in the alignment record will only represent the bases for its respective linear alignment. Corresponds to the JSON property `supplementaryAlignment` @return [Boolean]

supplementary_alignment?[RW]

Whether this alignment is supplementary. Equivalent to SAM flag 0x800. Supplementary alignments are used in the representation of a chimeric alignment. In a chimeric alignment, a read is split into multiple linear alignments that map to different reference contigs. The first linear alignment in the read will be designated as the representative alignment; the remaining linear alignments will be designated as supplementary alignments. These alignments may have different mapping quality scores. In each linear alignment in a chimeric alignment, the read will be hard clipped. The alignedSequence and alignedQuality fields in the alignment record will only represent the bases for its respective linear alignment. Corresponds to the JSON property `supplementaryAlignment` @return [Boolean]

Public Class Methods

new(**args) click to toggle source
# File generated/google/apis/genomics_v1beta2/classes.rb, line 1728
def initialize(**args)
   update!(**args)
end

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File generated/google/apis/genomics_v1beta2/classes.rb, line 1733
def update!(**args)
  @aligned_quality = args[:aligned_quality] unless args[:aligned_quality].nil?
  @aligned_sequence = args[:aligned_sequence] unless args[:aligned_sequence].nil?
  @alignment = args[:alignment] unless args[:alignment].nil?
  @duplicate_fragment = args[:duplicate_fragment] unless args[:duplicate_fragment].nil?
  @failed_vendor_quality_checks = args[:failed_vendor_quality_checks] unless args[:failed_vendor_quality_checks].nil?
  @fragment_length = args[:fragment_length] unless args[:fragment_length].nil?
  @fragment_name = args[:fragment_name] unless args[:fragment_name].nil?
  @id = args[:id] unless args[:id].nil?
  @info = args[:info] unless args[:info].nil?
  @next_mate_position = args[:next_mate_position] unless args[:next_mate_position].nil?
  @number_reads = args[:number_reads] unless args[:number_reads].nil?
  @proper_placement = args[:proper_placement] unless args[:proper_placement].nil?
  @read_group_id = args[:read_group_id] unless args[:read_group_id].nil?
  @read_group_set_id = args[:read_group_set_id] unless args[:read_group_set_id].nil?
  @read_number = args[:read_number] unless args[:read_number].nil?
  @secondary_alignment = args[:secondary_alignment] unless args[:secondary_alignment].nil?
  @supplementary_alignment = args[:supplementary_alignment] unless args[:supplementary_alignment].nil?
end