Assignment 3/assignment3.rb
# 6. writing a report file with genes of the ArabidopsisSubNetwork_GeneList.txt list that do NOT have exons with the CTTCTT repeat
6. writing a report file with genes of the ArabidopsisSubNetwork_GeneList.txt list that do NOT have exons with the CTTCTT repeat
6 . writing a report file with genes of the ArabidopsisSubNetwork_GeneList . txt list that do NOT have exons with the CTTCTT repeat
def report(file)
  File.open(file, 'w') do |line|
  line.puts "Genes (represented by AGI locus code) within ArabidopsisSubNetwork_GeneList.txt that do NOT have exons with the 'CTTCTT' repeat:"
  @all_biosequence.each do |gene, biosequence|
    features = Array.new
    biosequence.features.each do |feature|
      features << feature.feature 
    end
    next if features.include?("myrepeat")
    line.puts "#{gene}"
  end
  end
end
def report ( file ) File . open ( file , 'w' ) do | line | line . puts "Genes (represented by AGI locus code) within ArabidopsisSubNetwork_GeneList.txt that do NOT have exons with the 'CTTCTT' repeat:" @all_biosequence . each do | gene , biosequence | features = Array . new biosequence . features . each do | feature | features << feature . feature end next if features . include? ( "myrepeat" ) line . puts "#{gene}" end end end
6. writing a report file with genes of the ArabidopsisSubNetwork_GeneList.txt list that do NOT have exons with the CTTCTT repeat
6 . writing a report file with genes of the ArabidopsisSubNetwork_GeneList . txt list that do NOT have exons with the CTTCTT repeat
# open a file and write it line by line # iterating over hash # creating a new array to store features  # iterating over the features  # saving feature in array # next iteration if the array contains "myrepeat" feature  # writing the AGI locus code of those genes that don't have "myrepeat" as feature
file
<not_specific>