o
    Rŀg                     @   s@   d Z ddlmZ ddlmZ ddlmZ ddlmZ dd ZdS )	a?  Bio.SeqIO support for the "swiss" (aka SwissProt/UniProt) file format.

You are expected to use this module via the Bio.SeqIO functions.
See also the Bio.SwissProt module which offers more than just accessing
the sequences as SeqRecord objects.

See also Bio.SeqIO.UniprotIO.py which supports the "uniprot-xml" format.
    )
SeqFeature)	SwissProt)Seq)	SeqRecordc                 c   sN   t | }|D ]}tt|j|jd |j|j|jd}|j	D ]#}t
|dk r)q |dd \}}| d| }||jvrC|j| q |j}d|d< |j|d< |jrX|j|d	< |jrh|j\}	}
|	|d
< |
|d< |jrx|j\}	}
|	|d< |
|d< |jr|j\}	}
|	|d< |
|d< |jr|j|d< |jd|d< |j|d< |j|d< |jr|j|d< |jr|j|d< |jrd|j|d< |jrg |d< |jD ]N}t }ddd |jD |_|jD ]%\}}|dkr||_q|dkr||_ q|dkrq|dkrqt!d | d!|j"|_"|j#|_#|j$|_%|d | q|j&r!|j&|jd"< |V  qdS )#a  Break up a Swiss-Prot/UniProt file into SeqRecord objects.

    Argument source is a file-like object or a path to a file.

    Every section from the ID line to the terminating // becomes
    a single SeqRecord with associated annotation and features.

    This parser is for the flat file "swiss" format as used by:
     - Swiss-Prot aka SwissProt
     - TrEMBL
     - UniProtKB aka UniProt Knowledgebase

    For consistency with BioPerl and EMBOSS we call this the "swiss"
    format. See also the SeqIO support for "uniprot-xml" format.

    Rather than calling it directly, you are expected to use this
    parser via Bio.SeqIO.parse(..., format="swiss") instead.
    r   )idnamedescriptionfeatures   N:proteinmolecule_type
accessionsprotein_existencedatesequence_versiondate_last_sequence_updatedate_last_annotation_updateentry_version	gene_name.organismtaxonomy
ncbi_taxidorganism_hosthost_ncbi_taxid
comment
references c                 s   s    | ]}d | V  qdS )z%s=%s;N ).0k_vr    r    E/var/www/html/myenv/lib/python3.10/site-packages/Bio/SeqIO/SwissIO.py	<genexpr>]   s    z SwissIterator.<locals>.<genexpr>PubMedMEDLINEDOIAGRICOLAzUnknown key z found in referenceskeywords)'r   parser   r   sequencer   
entry_namer   r	   cross_referenceslendbxrefsappendannotationsr   createdsequence_updateannotation_updater   r   rstriporganism_classificationtaxonomy_idhost_organismhost_taxonomy_idcommentsjoinr   r   	Referencer   	pubmed_id
medline_id
ValueErrorauthorstitlelocationjournalr)   )sourceswiss_recordsswiss_recordrecordcross_referencedatabase	accessiondbxrefr1   r   version	referencefeaturekeyvaluer    r    r#   SwissIterator   s   














rQ   N)	__doc__Bior   r   Bio.Seqr   Bio.SeqRecordr   rQ   r    r    r    r#   <module>   s   	