MakeDb assigning failed germlines to None

Issue #140 resolved
Jason Vander Heiden created an issue

MakeDb is assigning None to GERMLINE_IMGT when a failure during germline reconstruction occurs. This should be an empty string instead.

Comments (9)

  1. Jason Vander Heiden reporter

    May be specific to MakeDb-igblast.

    First thing to check is that Receptor.ReceptorData.nucleotide (and Receptor.ReceptorData.aminoacid) properly converts None to an empty string when deparse=True. Changing the tuple from ('NA', 'None') to ('NA', 'None', None) may be sufficient (need to test).

  2. Kenneth Hoehn

    @javh I haven't been able to reproduce this in the example (S43) database. Any recommendations for data to reproduce this error?

  3. Jason Vander Heiden reporter

    Change the values of one of the positional fields in the igblast file (reference start/end, etc). That should force it to fail.

  4. Kenneth Hoehn

    Got it to work for igblast based on your suggestion. Think that's sufficient testing or do we need to try it on other input formats?

  5. Kenneth Hoehn

    changed line 589 of Receptor.py to:

    # Nucleotide sequence type conversion
    @staticmethod
    def nucleotide(v, deparse=False):
        if not deparse:
            try:
                #return '' if v in ('NA', 'None') else Seq(v, IUPAC.ambiguous_dna).upper()
                return '' if v in ('NA', 'None') else v.upper()
            except:
                return ''
        else:
            return '' if v in ('NA', 'None', None) else str(v)
    
  6. Kenneth Hoehn

    Also changed

        # Sequence type conversion
        @staticmethod
        def aminoacid(v, deparse=False):
            if not deparse:
                try:
                    #return '' if v in ('NA', 'None') else Seq(v, IUPAC.extended_protein).upper()
                    return '' if v in ('NA', 'None') else v.upper()
                except:
                    return ''
            else:
                return '' if v in ('NA', 'None', None) else str(v)
    
  7. Log in to comment