NAL-i5K / tripal_eutils

ncbi loader via the eutils interface
GNU General Public License v3.0
4 stars 3 forks source link

description not always added for biosample #180

Closed bradfordcondon closed 5 years ago

bradfordcondon commented 5 years ago

https://www.ncbi.nlm.nih.gov/biosample/?term=SAMN02261463

The strain used for genome sequencing originated from the inbred laboratory strains of solitarious locusts at the Institute of Zoology, CAS, China. Both colonies were reared under a 14:10 light/dark photo regime at 30℃ and on a diet of fresh greenhouse-grown wheat seedlings and wheat bran. To produce an even more inbred line, a sibling female adult and male adult mated each other and eight generations of sib mating then followed. DNA for genome sequencing was extracted from the whole body of one female adult.

description is blank for created biosample.

heres the XML:

  <Description>
      <Title>Inbreed whole body of Locusta migratoria</Title>
      <Organism taxonomy_id="7004" taxonomy_name="Locusta migratoria">
        <OrganismName>Locusta migratoria</OrganismName>
      </Organism>
      <Comment>
        <Paragraph>The strain used for genome sequencing originated from the inbred laboratory strains of solitarious locusts at the Institute of Zoology, CAS, China. Both colonies were reared under a 14:10 light/dark photo regime at 30℃ and on a diet of
          fresh greenhouse-grown wheat seedlings and wheat bran. To produce an even more inbred line, a sibling female adult and male adult mated each other and eight generations of sib mating then followed. DNA for genome sequencing was extracted from the
          whole body of one female adult.</Paragraph>
      </Comment>
    </Description>

this structure matches the descriptions in our examples so im surprised to see it doesnt load.

bradfordcondon commented 5 years ago
$description = (string) $xml->BioSample->Description->Comment ??
      $this->extractParagraphs($xml->BioSample->Description->Comment);

the problem with this code is that we get a not false, but effectively empty, string for $description. extractParagraphs never fires. strlen is 12. Instead we need to just use the paragraphs if they are present at all.