libraries/FlowCytometryHelper.rb
def copy_sample_matrix(from_collection:, to_collection:)
    sample_hash = Hash.new()
    from_collection_sample_types = from_collection.matrix.flatten.uniq.reject{|i| i == EMPTY }.map {|sample_id| [sample_id, Sample.find(sample_id)] }
    from_collection_sample_types.each {|sid, sample| (ALLOWABLE_FC_SAMPLETYPES.include? sample.sample_type.name) ? (sample_hash[sid] = sample) : (sample_hash[sid] = EMPTY) }
    dilution_sample_matrix = from_collection.matrix.map {|row| row.map {|sample_id| sample_hash[sample_id] } }
    to_collection.matrix = dilution_sample_matrix
    to_collection.save()
  end
# Overrides method found in HighThroughputHelper, so that only ALLOWABLE_FC_SAMPLETYPES are transferred to a new collection
Overrides method found in HighThroughputHelper, so that only ALLOWABLE_FC_SAMPLETYPES are transferred to a new collection
Overrides method found in HighThroughputHelper so that only ALLOWABLE_FC_SAMPLETYPES are transferred to a new collection
def copy_sample_matrix(from_collection:, to_collection:)
    sample_hash = Hash.new()
    from_collection_sample_types = from_collection.matrix.flatten.uniq.reject{|i| i == EMPTY }.map {|sample_id| [sample_id, Sample.find(sample_id)] }
    from_collection_sample_types.each {|sid, sample| (ALLOWABLE_FC_SAMPLETYPES.include? sample.sample_type.name) ? (sample_hash[sid] = sample) : (sample_hash[sid] = EMPTY) }
    dilution_sample_matrix = from_collection.matrix.map {|row| row.map {|sample_id| sample_hash[sample_id] } }
    to_collection.matrix = dilution_sample_matrix
    to_collection.save()
  end
def copy_sample_matrix ( from_collection : , to_collection : ) sample_hash = Hash . new ( ) from_collection_sample_types = from_collection . matrix . flatten . uniq . reject { | i | i == EMPTY } . map { | sample_id | [ sample_id , Sample . find ( sample_id ) ] } from_collection_sample_types . each { | sid , sample | ( ALLOWABLE_FC_SAMPLETYPES . include? sample . sample_type . name ) ? ( sample_hash [ sid ] = sample ) : ( sample_hash [ sid ] = EMPTY ) } dilution_sample_matrix = from_collection . matrix . map { | row | row . map { | sample_id | sample_hash [ sample_id ] } } to_collection . matrix = dilution_sample_matrix to_collection . save ( ) end
Overrides method found in HighThroughputHelper, so that only ALLOWABLE_FC_SAMPLETYPES are transferred to a new collection
Overrides method found in HighThroughputHelper so that only ALLOWABLE_FC_SAMPLETYPES are transferred to a new collection
from_collection
to_collection