sfftk.notes
package
Find notes
sfftk.notes.find
Search for terms and display ontologies
- class sfftk.notes.find.CSVRow(row_data, fields, index, *args, **kwargs)[source]
Bases:
Table
Class definition for a single row in the table
- class sfftk.notes.find.CSVTable(search_results, fields, width='auto', *args, **kwargs)[source]
Bases:
Table
Class that formats search results as a CSV
- class sfftk.notes.find.ResultsTable(search_results, fields, width='auto', *args, **kwargs)[source]
Bases:
Table
Class that formats search results as a table
- class sfftk.notes.find.SearchResource(args, configs)[source]
Bases:
object
A resource against which to look for accessions or terms
- class sfftk.notes.find.SearchResults(resource, as_text=False)[source]
Bases:
object
SearchResults class
- class sfftk.notes.find.TableField(name, key=None, text=None, width=20, pc=None, justify='left', _format=None, is_index=False, is_iterable=False, position_in_iterable=0)[source]
Bases:
object
Class definition for a TableField - single column in a table
- property is_index
Is this field an index (numbered) field?
- property pc
The width of the field in percent; resolves to a character width
- property width
The width of the field in characters
View notes
sfftk.notes.view
Display notes in EMDB-SFF files
- class sfftk.notes.view.HeaderView(segmentation)[source]
Bases:
View
HeaderView class
Display EMDB-SFF header
- class sfftk.notes.view.NoteView(segment, _long=False, list_ids=False)[source]
Bases:
View
NoteView class
Display annotation for a single segment
- class sfftk.notes.view.TableHeaderView[source]
Bases:
View
Class defining the view of a table header object
- sfftk.notes.view.list_notes(args, configs)[source]
List all notes in an EMDB-SFF file
- Parameters:
args (
argparse.Namespace
) – parsed arguments- Return status:
0 is OK, else failure
- Rtype status:
int
- sfftk.notes.view.show_notes(args, configs)[source]
Show notes in an EMDB-SFF file for the specified segment IDs
- Parameters:
args (
argparse.Namespace
) – parsed arguments- Return status:
0 is OK, else failure
- Rtype status:
int
Modify notes
sfftk.notes.modify
Add, edit and delete terms in EMDB-SFF files
- class sfftk.notes.modify.AbstractGlobalNote[source]
Bases:
BaseNote
Abstract class definition for global annotations which defines attributes of global annotation.
Also defines three methods that effect the annotation to a segmentation object:
- add_to_segmentation(segmentation)[source]
Adds this note to the given segmentation
- Parameters:
segmentation (
sfftkrw.SFFSegmentation
) – an EMDB-SFF segmentation object- Return segmentation:
the EMDB-SFF segmentation with the annotation added
- del_from_segmentation(segmentation)[source]
Delete attributes from a segmentation
- Parameters:
segmentation (
sfftkrw.SFFSegmentation
) – an EMDB-SFF segmentation object- Return segmentation:
the EMDB-SFF segmentation with annotation deleted
- Rtype segmentation:
- edit_in_segmentation(segmentation)[source]
Modify the global annotation of the given segmentation
- Parameters:
segmentation (
sfftkrw.SFFSegmentation
) – an EMDB-SFF segmentation object- Return segmentation:
the EMDB-SFF segmentation with annotated edited
- Rtype segmentation:
- class sfftk.notes.modify.AbstractNote[source]
Bases:
BaseNote
Note ‘abstact’ class that defines private attributes and main methods
- add_to_segment(segment)[source]
Add the annotations found in this
Note
object to thesfftkrw.SFFSegment
object- Parameters:
segment (
sfftkrw.SFFSegment
) – single segment in EMDB-SFF
- del_from_segment(segment)[source]
Delete the annotations found in this
Note
object to thesfftkrw.SFFSegment
object- Parameters:
segment (
sfftkrw.SFFSegment
) – single segment in EMDB-SFF
- edit_in_segment(segment)[source]
Edit the annotations found in this
Note
object to thesfftkrw.SFFSegment
object- Parameters:
segment (
sfftkrw.SFFSegment
) – single segment in EMDB-SFF
- class sfftk.notes.modify.ArgsNote(args, configs, *args_, **kwargs_)[source]
Bases:
AbstractNote
Class definition for an ArgsNote object
- class sfftk.notes.modify.ExternalReference(resource=None, url=None, accession=None)[source]
Bases:
object
Class definition for a
ExternalReference
object- property iri
The IRI value should be double url-encoded
- class sfftk.notes.modify.GlobalArgsNote(args, configs, *args_, **kwargs_)[source]
Bases:
AbstractGlobalNote
Class defining segmentation (global) annotation based on command-line arguments
- Parameters:
args – an
argparse.Namespace
objectconfigs – persistent configurations for
sfftk
- class sfftk.notes.modify.GlobalSimpleNote(name=None, software_id=None, software_name=None, software_version=None, software_processing_details=None, transform_id=None, transform=None, details=None, external_reference_id=None, external_references=None, *args, **kwargs)[source]
Bases:
AbstractGlobalNote
Class definition for global segmentation notes
- class sfftk.notes.modify.NoteAttr(initval=None, name='var')[source]
Bases:
object
Descriptor class for note attributes
- Parameters:
initval – the initial value of the attribute (default:
None
)name (str) – the name of the variable (default: ‘var’)
- class sfftk.notes.modify.SimpleNote(name=None, description=None, number_of_instances=None, external_reference_id=None, external_references=None, *args, **kwargs)[source]
Bases:
AbstractNote
Class definition for a
SimpleNote
object
- sfftk.notes.modify.add_note(args, configs)[source]
Add annotation to a segment specified in args
- Parameters:
args (
argparse.Namespace
) – parsed argumentsconfigs (
sfftk.core.configs.Configs
) – configurations object
- Return status:
status
- Rtype status:
int
- sfftk.notes.modify.clear_notes(args, configs)[source]
Clear notes from segments
- Parameters:
args (
argparse.Namespace
) – parsed argumentsconfigs (
sfftk.core.configs.Configs
) – configurations object
- Return status:
status
- Rtype status:
int
- sfftk.notes.modify.copy_notes(args, configs)[source]
Copy notes across segments
One or more segments can be chosen for either or both source and destination
- Parameters:
args (
argparse.Namespace
) – parsed argumentsconfigs (
sfftk.core.configs.Configs
) – configurations object
- Return status:
status
- Rtype status:
int
- sfftk.notes.modify.del_note(args, configs)[source]
Delete annotation to a segment specified in args
- Parameters:
args (
argparse.Namespace
) – parsed argumentsconfigs (
sfftk.core.configs.Configs
) – configurations object
- Return status:
status
- Rtype status:
int
- sfftk.notes.modify.edit_note(args, configs)[source]
Edit annotation to a segment specified in args
- Parameters:
args (
argparse.Namespace
) – parsed argumentsconfigs (
sfftk.core.configs.Configs
) – configurations object
- Return status:
status
- Rtype status:
int
- sfftk.notes.modify.merge(args, configs)[source]
Merge notes from two EMDB-SFF files
- Parameters:
args (
argparse.Namespace
) – parsed argumentsconfigs (
sfftk.core.configs.Configs
) – configurations object
- Return status:
status
- Rtype status:
int
- sfftk.notes.modify.save(args, configs)[source]
Save changes made
- Parameters:
args (
argparse.Namespace
) – parsed argumentsconfigs (
sfftk.core.configs.Configs
) – configurations object
- Return status:
status
- Rtype status:
int
- sfftk.notes.modify.trash(args, configs)[source]
Trash changes made
- Parameters:
args (
argparse.Namespace
) – parsed argumentsconfigs (
sfftk.core.configs.Configs
) – configurations object
- Return status:
status
- Rtype status:
int