User Manual for Acmacs.corebundle - acjim/AcmacsDesktop GitHub Wiki

MANUAL

Usage: api-acjim.py [options] <input.json></input.json> <input.data></input.data> <output.json></output.json> [<output.acd1.bz2></output.acd1.bz2>]

API for Ronald Moore's 2015 team (acjim).

export - Exports chart into one of the external formats.

acd1_v2.bz2, acd1_v2.xz, acd1_v3, acd1_v3.bz2, acd1_v3.xz, acd1_v4, acd1_v4.bz2, acd1_v4.xz, acmacs-txt, 
acmacs-txt.bz2, acmacs-txt.xz, acmacs_web_edit, acmacs_web_edit.bz2, acmacs_web_edit.xz, acp1, acp1.bz2, 
acp1.xz, acp1_v2, acp1_v2.bz2, acp1_v2.xz, acp1_v3, acp1_v3.bz2, acp1_v3.xz, acp1_v4, acp1_v4.bz2, acp1_v4.xz,
 csv, csv.bz2, csv.xz, json, json.bz2, json.xz, kmeans, kmeans.bz2, kmeans.xz, layout, layout.bz2, layout.xz,
 layout-country-year, layout-country-year.bz2, layout-country-year.xz, layout-host-country-year, 
layout-host-country-year.bz2, layout-host-country-year.xz, layout-species-country-year, 
layout-species-country-year.bz2, layout-species-country-year.xz, layout_country_year, layout_country_year.bz2,
layout_country_year.xz, layout_host_country_year, layout_host_country_year.bz2, layout_host_country_year.xz, 
layout_species_country_year, layout_species_country_year.bz2, layout_species_country_year.xz, lispmds, 
lispmds.bz2, lispmds.xz, map_distances, map_distances.bz2, map_distances.xz, plot_spec, plot_spec.bz2, 
plot_spec.xz, plot_spec.txt, plot_spec.txt.bz2, plot_spec.txt.xz, plot_style, plot_style.bz2, 
plot_style.xz, plot_style.txt, plot_style.txt.bz2, plot_style.txt.xz, save, save.bz2, save.xz, table, 
table.bz2, table.xz, text, text.bz2, text.xz, text_with_logged_titers, text_with_logged_titers.bz2, text_with_logged_titers.xz
  Mandatory data fields:
    format: str
    filename: str
  Result object:

get_error_lines - Obtains error lines data for a projection

  Mandatory data fields:
  Optional data fields:
    projection: int (default: 0)
  Result object:
    'error_lines' - for each antigen and serum list of opposite coordinates for each error line

get_info - Get information about chart.

  Mandatory data fields:
  Result object:
    'name' - compiled table name
    'number_of_antigens' - 
    'projections' - list of object with information about each projection: number of dimensions, stress
    'number_of_sera' - 

get_map - Obtains map data (coordinates, plot specification)

  Mandatory data fields:
  Optional data fields:
    blob_stress_diff: float (default: 0.1)
    blobs: bool (default: False)
    blob_number_of_directions: int (default: 36)
    projection: int (default: 0)
    error_lines: bool (default: False)
  Result object:
    'blobs' - for each point radii of a blob perimeter for each direction
    'stress' - stress of the projection
    'error_lines' - for each antigen and serum list of opposite coordinates for each error line
    'map':
      'styles':
        'styles' - list of point properties to show
        'points' - index in styles list for each point
        'drawing_order' - list of point indices in order of drawing, so the last indices are drawn on top of the first ones
      'point_indices_per_page' - for time series, ignore it
      'center' - coordinates of the center of the map
      'layout' - list of coordinates of the objects on the map
      'background' - object describing background color and borderline (can be ignored)
      'viewport_origin' - origin of the viewport to show the map
      'scale' - information about general scales for labels and points
      'viewport_size' - width and height of the viewport
      'border_space' - space to leave around the map, in units
      'point_info' - list of objects with information about each point, can be used to cosntruct point label
      'transformation' - map transformation matrix, to apply to layout to properly orient the map
      'diameter' - width and height of the map (usually the same and whole numbers)
      'show_labels' - if labels must be shown initially
      'version' - ignore
      'grid' - information about grid to show

get_table - Obtains table data (antigens, sera, titers) to present it to the user.

  Mandatory data fields:
  Result object:
    'table':
      'antigens' - list of object with various antigen attributes: date, name, passage, passage_type, reference, reassortant, mutations
      'names_unmodifiable' - true to stop acmacs parsing antigen and serum names
      'sera' - list of object with various serum attributes: name, serum_id, passage, serum_species, reassortant, mutations
      'type' - antigenic or genetic
      'titers':
        'titers_list_of_list' - list of lists of titers
        'number_of_layers' - 0 - for simple table, >1 - for multi-layered table
    'info':
      'date' - YYYY-MM-DD[.VVV] - date of assay and optional number (if multiple similar assays performed on that day)
      'influenza':
        'rbc_id' - 
        'rbc_species' - guinea-pig
        'virus_type' - A(H3N2)
      'name' - 
      'sera_species' - serum species
      'lab' - 
      'comment' - 
      'assay' - HI
      'virus' - influenza, hpv, denge, generic
      'author' - 

import - Imports table or chart in one of the supported by acmacs format (txt, xls, acd1, etc.)

  Mandatory data fields:
    name: str
  Optional data fields:
    parse_antigen_names: bool (default: False)
  Result object:
    'messages' - list of strings reporting warning and fixes occured during table importing

make_new_projection - Clones existing projection and updates coordinates in it.

  Mandatory data fields:
    coordinates: list
    projection: int or str
  Optional data fields:
    comment: str (default: '')
  Result object:
    'stress' - resulting stress
    'comment' - resulting projection comment (if provided)
    'projection' - resulting projection number

relax - Makes map

  Mandatory data fields:
    number_of_dimensions: int
    number_of_optimizations: int
  Optional data fields:
    rough_optimization: bool (default: False)
    blob_stress_diff: float (default: 0.1)
    blob_number_of_directions: int (default: 36)
    error_lines: bool (default: False)
    best_map: bool (default: False)
    minimum_column_basis: str (default: 'none')
    disconnect_having_few_titers: bool (default: True)
    blobs: bool (default: False)
  Result object:
    'best_map' - see result.map of get_map command
    'blobs' - see result.blobs of get_map command
    'stresses' - list of stresses of all projections stored in the chart
    'error_lines' - see result.error_lines of get_map command

relax_existing - Relaxes existing projection

  Mandatory data fields:
    projection: int or str
  Optional data fields:
    rough_optimization: bool (default: False)
  Result object:
    'stress' - resulting stress
    'comment' - resulting projection comment (if present)
    'projection' - resulting projection number (may difer from passed)

set_disconnected_points - Sets disconnection attribute for the listed points. Disconnected points are not touched by the optimization engine, they are not moved and they do not contribute to stress. If list is empty, all points are made connected (regular). Passed list contains just point indices, first come antigens starting with 0, then come sera, index of the first serum is equal to the number of antigens in the table.

  Mandatory data fields:
    disconnected: list
    projection: int or str
  Result object:

set_unmovable_points - Sets unmovable attribute for the listed points. Unmovable points cannot be moved by the optimization engine, their coordinates are fixed, but they do contribute to stress. If list is empty, all points are made movable (regular). Passed list contains just point indices, first come antigens starting with 0, then come sera, index of the first serum is equal to the number of antigens in the table.

  Mandatory data fields:
    unmovable: list
    projection: int or str
  Result object:

update_table - Updates table with changes supplied by the user. Supplied data corresponds to the data obtained via get_table command. Antigens/sera can be removed and new antigens/sera can be added. Modifying titers, removing/adding antigens/sera is forbidden if chart has projections and remove_existing_projections optional argument is false (default).

  Mandatory data fields:
    table: dict
    info: dict
    version: int
  Optional data fields:
    remove_existing_projections: bool (default: False)
  Result object:

Options:

  -h, --help            show this help message and exit
  --test                Test the program.
  --log-file=LOG_FILE   Send all the logging output to that file.
  --log-level=LOG_LEVEL
                        Logging level.
  --debug               Set logging level to DEBUG.
  --warning             Set logging level to WARNING.
  --log-passages=LOG_PASSAGES
                        Send logging output for the passages module(s) to that
                        file.
  --log-serum-id=LOG_SERUM_ID
                        Send logging output for the serum_id module(s) to that
                        file.
  --no-memory-leaks     Do not report memory leaks on exit.
  --memory-usage        Report memory usage on exit.
 3 to 4 arguments expected in the command line 
⚠️ **GitHub.com Fallback** ⚠️