nodes: 0, module; 1, function_definition; 2, function_name:_add_compounds; 3, parameters; 4, block; 5, identifier:self; 6, identifier:variant_obj; 7, identifier:info_dict; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, if_statement; 12, comment:#Sort the compounds based on rank score; 13, expression_statement; 14, for_statement; 15, comment:"""Check if there are any compounds and add them to the variant
          
              The compounds that are added should be sorted on rank score
          """; 16, assignment; 17, assignment; 18, identifier:compound_entry; 19, block; 20, call; 21, identifier:compound; 22, identifier:compound_list; 23, block; 24, identifier:compound_list; 25, list; 26, identifier:compound_entry; 27, call; 28, for_statement; 29, attribute; 30, argument_list; 31, expression_statement; 32, attribute; 33, argument_list; 34, identifier:family_annotation; 35, call; 36, block; 37, identifier:compound_list; 38, identifier:sort; 39, keyword_argument; 40, keyword_argument; 41, call; 42, identifier:info_dict; 43, identifier:get; 44, string; 45, attribute; 46, argument_list; 47, expression_statement; 48, for_statement; 49, identifier:key; 50, call; 51, identifier:reverse; 52, True; 53, attribute; 54, argument_list; 55, string_content:Compounds; 56, identifier:compound_entry; 57, identifier:split; 58, string; 59, assignment; 60, identifier:compound; 61, identifier:compounds; 62, block; 63, attribute; 64, argument_list; 65, identifier:variant_obj; 66, identifier:add_compound; 67, identifier:compound; 68, string_content:,; 69, identifier:compounds; 70, call; 71, expression_statement; 72, expression_statement; 73, if_statement; 74, expression_statement; 75, identifier:operator; 76, identifier:attrgetter; 77, string; 78, attribute; 79, argument_list; 80, assignment; 81, assignment; 82, comparison_operator:len(splitted_compound) > 1; 83, block; 84, call; 85, string_content:combined_score; 86, subscript; 87, identifier:split; 88, string; 89, identifier:splitted_compound; 90, call; 91, identifier:compound_score; 92, None; 93, call; 94, integer:1; 95, expression_statement; 96, expression_statement; 97, attribute; 98, argument_list; 99, call; 100, unary_operator; 101, string_content:|; 102, attribute; 103, argument_list; 104, identifier:len; 105, argument_list; 106, assignment; 107, assignment; 108, identifier:compound_list; 109, identifier:append; 110, call; 111, attribute; 112, argument_list; 113, integer:1; 114, identifier:compound; 115, identifier:split; 116, string; 117, identifier:splitted_compound; 118, identifier:compound_id; 119, subscript; 120, identifier:compound_score; 121, call; 122, identifier:Compound; 123, argument_list; 124, identifier:family_annotation; 125, identifier:split; 126, string; 127, string_content:>; 128, identifier:splitted_compound; 129, integer:0; 130, identifier:int; 131, argument_list; 132, keyword_argument; 133, keyword_argument; 134, string_content::; 135, subscript; 136, identifier:variant_id; 137, identifier:compound_id; 138, identifier:combined_score; 139, identifier:compound_score; 140, identifier:splitted_compound; 141, unary_operator; 142, integer:1
code: def _add_compounds(self, variant_obj, info_dict):
          """Check if there are any compounds and add them to the variant
          
              The compounds that are added should be sorted on rank score
          """
          compound_list = []
          compound_entry = info_dict.get('Compounds')
          if compound_entry:
              for family_annotation in compound_entry.split(','):
                  compounds = family_annotation.split(':')[-1].split('|')
                  for compound in compounds:
                      splitted_compound = compound.split('>')
  
                      compound_score = None
                      if len(splitted_compound) > 1:
                          compound_id = splitted_compound[0]
                          compound_score = int(splitted_compound[-1])
                      
                      compound_list.append(Compound(
                          variant_id=compound_id,
                          combined_score=compound_score
                          )
                      )
          
          #Sort the compounds based on rank score
          compound_list.sort(key = operator.attrgetter('combined_score'), reverse=True)
          
          for compound in compound_list:
              variant_obj.add_compound(compound)