Skip to content

Commit

Permalink
modified Contig and Read classes in Ace
Browse files Browse the repository at this point in the history
  • Loading branch information
fstrozzi committed Jan 12, 2011
1 parent 03a1b7e commit 85241ed
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions lib/bio-assembly/ace.rb
Expand Up @@ -28,8 +28,9 @@ def to_ace
end

private

def parse_contig(attrs)
contig = Bio::Assembly::Contig.new
contig = Contig.new
contig.name, base_num, @num_reads, base_segments_num, contig.orientation = attrs.split(" ")
# keep track of the number of RD identifiers parsed
@num_rds_parsed = 0
Expand Down Expand Up @@ -76,7 +77,7 @@ def parse_bq(contig)

# parse read meta data
def parse_af(contig, attrs)
read = Bio::Assembly::Read.new
read = Read.new
read.name , read.orientation, read.from = attrs.split(" ")
contig.add_read read
end
Expand Down Expand Up @@ -132,11 +133,9 @@ def parse_wa(contig, attrs)
# parse run meta data - ignored
def parse_ct(contig, attrs)
end

end # => end class Ace

# open contig class and write ace specific methods for contig objects
class Contig
# extend contig class and write ace specific methods for contig objects
class Contig < Bio::Assembly::Contig

def to_ace
ace = ""
Expand Down Expand Up @@ -169,10 +168,10 @@ def to_ace
ace
end

end # => end Contig class
end # => end Contig class

# open Read class to add ace specific methods for read objects
class Read
# extend Read class to add ace specific methods for read objects
class Read < Bio::Assembly::Read

attr_accessor :base_sequences

Expand Down Expand Up @@ -231,7 +230,7 @@ def initialize(from, to, read_name)
end

def <=>(other)
unless other.kind_of?(Bio::Assembly::Read::BaseSequence)
unless other.kind_of?(Bio::Assembly::AceRead::BaseSequence)
raise "[Error] markers are not comparable"
end
if self.from == other.from
Expand All @@ -244,8 +243,8 @@ def <=>(other)

end # => end BaseSequence Class

end # => end Read Class

end # => end Read Class
end # => end class Ace

end # => end class Assembly
end # => end module Bio

0 comments on commit 85241ed

Please sign in to comment.