<commit_before>require 'resque'

class Deletegenotype
   @queue = :deletegenotype

   def self.perform(genotyp)
      @genotype = Genotype.find_by_id(genotyp["genotype"]["id"].to_i)
	  # find all relevant user_snps
	  @user_snps = UserSnp.find_by_user_id(@genotype.user_id)
	  # now parse through all user_snps, delete the relevant SNP if the user_snp is the only one, then delete the user_snp
	  @user_snps.each do |us|
		  @snp = Snp.find_by_id(us.snp_id)
		  if @snp.user_snps.length == 1 # this user_snp is the only one
             Snp.delete(@snp)
		  end
		  UserSnp.delete(us)
	  end
   end
end<commit_msg>fuck, deleting does not work<commit_after>require 'resque'

class Deletegenotype
   @queue = :deletegenotype

   def self.perform(genotyp)
     print genotyp["genotype"]["id"].to_i
     print Genotype.find_by_id(genotyp["genotype"]["id"].to_i)
     @genotype = Genotype.find_by_id(genotyp["genotype"]["id"].to_i) 
     print "got genotype-file\n"
     print @genotype
	  # find all relevant user_snps
	  @user_snps = UserSnp.find_all_by_user_id(@genotype.user_id)
	  # now parse through all user_snps, delete the relevant SNP if the user_snp is the only one, then delete the user_snp
	  @user_snps.each do |us|
		  @snp = Snp.find_by_id(us.snp_id)
		  if @snp.user_snps.length == 1 # this user_snp is the only one
             Snp.delete(@snp)
		  end
		  UserSnp.delete(us)
	  end
   end
end
{'fraction_non_alphanumeric': 0.10312944523470839, 'fraction_numerical': 0.001422475106685633, 'mean_word_length': 3.5241157556270095, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1044138', 'n_tokens_mistral': 559, 'n_tokens_neox': 525, 'n_words': 124}