diff --git a/clinvar_this/io/tsv.py b/clinvar_this/io/tsv.py index 5cffcb4..53dbfd8 100644 --- a/clinvar_this/io/tsv.py +++ b/clinvar_this/io/tsv.py @@ -692,6 +692,7 @@ def record_pubmed_citations( ) for pmid in record.pmids ] + return None def record_clinical_features( record: SeqVarTsvRecord, @@ -877,7 +878,8 @@ def _hpo_terms(submission: SubmissionClinvarSubmission) -> typing.Optional[typin def _pmids(submission: SubmissionClinvarSubmission) -> typing.Optional[typing.List[str]]: if citations := submission.clinical_significance.citation: - return [c.id for c in citations if c.db == CitationDb.PUBMED] + return [c.id for c in citations if c.db == CitationDb.PUBMED and c.id] + return None def submission_to_seq_var_tsv_record( submission: SubmissionClinvarSubmission, @@ -976,7 +978,8 @@ def _inheritance(submission: SubmissionClinvarSubmission) -> typing.Optional[Mod def _pmids(submission: SubmissionClinvarSubmission) -> typing.Optional[typing.List[str]]: if citations := submission.clinical_significance.citation: - return [c.id for c in citations if c.db == CitationDb.PUBMED] + return [c.id for c in citations if c.db == CitationDb.PUBMED and c.id] + return None def submission_to_struc_var_tsv_record( submission: SubmissionClinvarSubmission,