Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-generate docs #3278

Merged
merged 31 commits into from
Oct 26, 2022
Merged

Auto-generate docs #3278

merged 31 commits into from
Oct 26, 2022

Conversation

cmdcolin
Copy link
Collaborator

@cmdcolin cmdcolin commented Oct 18, 2022

This begins a project of trying to automatically generate docs for config, and probably, the state model objects would also be valuable

I used the typescript compiler itself to parse out doc strings that have !config and !slot strings

currently looks like this

It currently inserts raw snippets of typescript text into the config docs. I think this is better than nothing

It is helpful to have api docs once you are getting really into the weeds. developers know their way around the codebase but as a user of a library, you don't really want to dig into the code to find these details, but if there is a bit of code in the docs, that is ok.

current output in a single long MD file looks like this:

fixes #948

BamAdapter

used to configure BAM adapter

slot: bamLocation

      /**
       * !slot
       */
      bamLocation: {
        type: 'fileLocation',
        defaultValue: { uri: '/path/to/my.bam', locationType: 'UriLocation' },
      }

slot: index.indexType

        /**
         * !slot index.indexType
         */
        indexType: {
          model: types.enumeration('IndexType', ['BAI', 'CSI']),
          type: 'stringEnum',
          defaultValue: 'BAI',
        }

slot: index.location

        /**
         * !slot index.location
         */
        location: {
          type: 'fileLocation',
          defaultValue: {
            uri: '/path/to/my.bam.bai',
            locationType: 'UriLocation',
          },
        }

slot: fetchSizeLimit

      /**
       * !slot
       */
      fetchSizeLimit: {
        type: 'number',
        description:
          'used to determine when to display a warning to the user that too much data will be fetched',
        defaultValue: 5_000_000,
      }

slot: sequenceAdapter

      /**
       * !slot
       * generally refers to the reference genome assembly's sequence adapter
       * currently needs to be manually added
       */
      sequenceAdapter: {
        type: 'frozen',
        description:
          'sequence data adapter, used to calculate SNPs when BAM reads lacking MD tags',
        defaultValue: null,
      }

CramAdapter

used to configure CRAM adapter

slot: fetchSizeLimit

      /**
       * !slot fetchSizeLimit
       */
      fetchSizeLimit: {
        type: 'number',
        description:
          'used to determine when to display a warning to the user that too much data will be fetched',
        defaultValue: 3_000_000,
      }

slot: cramLocation

      /**
       * !slot cramLocation
       */
      cramLocation: {
        type: 'fileLocation',
        defaultValue: {
          uri: '/path/to/my.cram',
          locationType: 'UriLocation',
        },
      }

slot: craiLocation

      /**
       * !slot craiLocation
       */
      craiLocation: {
        type: 'fileLocation',
        defaultValue: {
          uri: '/path/to/my.cram.crai',
          locationType: 'UriLocation',
        },
      }

slot: sequenceAdapter

      /**
       * !slot sequenceAdapter
       * generally refers to the reference genome assembly's sequence adapter
       * currently needs to be manually added
       */
      sequenceAdapter: pluginManager.pluggableConfigSchemaType('adapter')

HtsgetBamAdapter

Used to fetch data from Htsget endpoints in BAM format
Uses @gmod/bam

slot: htsgetBase

      /**
       * !slot
       */
      htsgetBase: {
        type: 'string',
        description: 'the base URL to fetch from',
        defaultValue: '',
      }

slot: htsgetTrackId

      /**
       * !slot
       */
      htsgetTrackId: {
        type: 'string',
        description: 'the trackId, which is appended to the base URL',
        defaultValue: '',
      }

slot: sequenceAdapter

      /**
       * !slot
       */
      sequenceAdapter: {
        type: 'frozen',
        description:
          'sequence data adapter, used to calculate SNPs when BAM reads lacking MD tags',
        defaultValue: null,
      }

LinearAlignmentsDisplay

has a "pileup" sub-display, where you can see individual reads and a
quantitative "snpcoverage" sub-display track showing SNP frequencies

slot: pileupDisplay

      /**
       * !slot
       */
      pileupDisplay: pluginManager.getDisplayType('LinearPileupDisplay')
        .configSchema

slot: snpCoverageDisplay

      /**
       * !slot
       */
      snpCoverageDisplay: pluginManager.getDisplayType(
        'LinearSNPCoverageDisplay',
      ).configSchema

derives from:

      /**
       * !baseConfiguration
       */
      baseConfiguration: baseLinearDisplayConfigSchema

LinearPileupDisplay

slot: defaultRendering

      /**
       * !slot
       */
      defaultRendering: {
        type: 'stringEnum',
        model: types.enumeration('Rendering', ['pileup']),
        defaultValue: 'pileup',
      }

slot: renderers

      /**
       * !slot
       */
      renderers: ConfigurationSchema('RenderersConfiguration', {
        PileupRenderer:
          pluginManager.getRendererType('PileupRenderer').configSchema,
      })

slot: maxFeatureScreenDensity

      /**
       * !slot
       */
      maxFeatureScreenDensity: {
        type: 'number',
        description: 'maximum features per pixel that is displayed in the view',
        defaultValue: 5,
      }

slot: colorScheme

      /**
       * !slot
       */
      colorScheme: {
        type: 'stringEnum',
        model: types.enumeration('colorScheme', [
          'strand',
          'normal',
          'insertSize',
          'insertSizeAndOrientation',
          'mappingQuality',
          'tag',
        ]),
        description: 'color scheme to use',
        defaultValue: 'normal',
      }

derives from:

      /**
       * !baseConfiguration
       */
      baseConfiguration: linearBasicDisplayConfigSchemaFactory(pluginManager)

LinearSNPCoverageDisplay

slot: autoscale

      /**
       * !slot
       */
      autoscale: {
        type: 'stringEnum',
        defaultValue: 'local',
        model: types.enumeration('Autoscale type', ['local']),
        description:
          'performs local autoscaling (no other options for SNP Coverage available)',
      }

slot: minScore

      /**
       * !slot
       */
      minScore: {
        type: 'number',
        defaultValue: Number.MIN_VALUE,
        description: 'minimum value for the y-scale',
      }

slot: maxScore

      /**
       * !slot
       */
      maxScore: {
        type: 'number',
        description: 'maximum value for the y-scale',
        defaultValue: Number.MAX_VALUE,
      }

slot: scaleType

      /**
       * !slot
       */
      scaleType: {
        type: 'stringEnum',
        model: types.enumeration('Scale type', ['linear', 'log']), // todo zscale
        description: 'The type of scale to use',
        defaultValue: 'linear',
      }

slot: inverted

      /**
       * !slot
       */ inverted: {
        type: 'boolean',
        description: 'draw upside down',
        defaultValue: false,
      }

slot: multiTicks

      /**
       * !slot
       */
      multiTicks: {
        type: 'boolean',
        description: 'Display multiple values for the ticks',
        defaultValue: false,
      }

slot: renderers

      /**
       * !slot
       */
      renderers: ConfigurationSchema('RenderersConfiguration', {
        SNPCoverageRenderer: pluginManager.getRendererType(
          'SNPCoverageRenderer',
        ).configSchema,
      })

derives from:

      /**
       * !baseConfiguration
       */
      baseConfiguration: baseLinearDisplayConfigSchema

PileupRenderer

slot: color

    /**
     * !slot
     * default magenta here is used to detect the user has not customized this
     */
    color: {
      type: 'color',
      description: 'the color of each feature in a pileup alignment',
      defaultValue: '#f0f',
      contextVariable: ['feature'],
    }

slot: orientationType

    /**
     * !slot
     */
    orientationType: {
      type: 'stringEnum',
      model: types.enumeration('orientationType', ['fr', 'rf', 'ff']),
      defaultValue: 'fr',
      description:
        'read sequencer orienation. fr is normal "reads pointing at each other ---> <--- while some other sequencers can use other options',
    }

slot: displayMode

    /**
     * !slot
     */
    displayMode: {
      type: 'stringEnum',
      model: types.enumeration('displayMode', [
        'normal',
        'compact',
        'collapse',
      ]),
      description: 'Alternative display modes',
      defaultValue: 'normal',
    }

slot: minSubfeatureWidth

    /**
     * !slot
     */
    minSubfeatureWidth: {
      type: 'number',
      description:
        'the minimum width in px for a pileup mismatch feature. use for increasing/decreasing mismatch marker widths when zoomed out, e.g. 0 or 1',
      defaultValue: 0.7,
    }

slot: maxHeight

    /**
     * !slot
     */
    maxHeight: {
      type: 'integer',
      description: 'the maximum height to be used in a pileup rendering',
      defaultValue: 1200,
    }

slot: maxClippingSize

    /**
     * !slot
     */
    maxClippingSize: {
      type: 'integer',
      description: 'the max clip size to be used in a pileup rendering',
      defaultValue: 10000,
    }

slot: height

    /**
     * !slot
     */
    height: {
      type: 'number',
      description: 'the height of each feature in a pileup alignment',
      defaultValue: 7,
      contextVariable: ['feature'],
    }

slot: noSpacing

    /**
     * !slot
     */
    noSpacing: {
      type: 'boolean',
      description: 'remove spacing between features',
      defaultValue: false,
    }

slot: largeInsertionIndicatorScale

    /**
     * !slot
     */
    largeInsertionIndicatorScale: {
      type: 'number',
      description:
        'scale at which to draw the large insertion indicators (bp/pixel)',
      defaultValue: 10,
    }

slot: mismatchAlpha

    /**
     * !slot
     */
    mismatchAlpha: {
      type: 'boolean',
      defaultValue: false,
      description: 'Fade low quality mismatches',
    }

SNPCoverageAdapter

slot: subadapter

      /**
       * !slot
       * normally refers to a BAM or CRAM adapter
       */
      subadapter: pluginManager.pluggableConfigSchemaType('adapter')

SNPCoverageRenderer

slot: clipColor

    /**
     * !slot
     */
    clipColor: {
      type: 'color',
      description: 'the color of the clipping marker',
      defaultValue: 'red',
    }

slot: indicatorThreshold

    /**
     * !slot
     */
    indicatorThreshold: {
      type: 'number',
      description:
        'the proportion of reads containing a insertion/clip indicator',
      defaultValue: 0.4,
    }

slot: drawArcs

    /**
     * !slot
     */
    drawArcs: {
      type: 'boolean',
      description: 'Draw sashimi-style arcs for intron features',
      defaultValue: true,
    }

slot: drawInterbaseCounts

    /**
     * !slot
     */
    drawInterbaseCounts: {
      type: 'boolean',
      description:
        'draw count "upsidedown histogram" of the interbase events that don\'t contribute to the coverage count so are not drawn in the normal histogram',
      defaultValue: true,
    }

slot: drawIndicators

    /**
     * !slot
     */
    drawIndicators: {
      type: 'boolean',
      description:
        'draw a triangular indicator where an event has been detected',
      defaultValue: true,
    }

ArcRenderer

slot: color

    /**
     * !slot
     */
    color: {
      type: 'color',
      description: 'the color of the arcs',
      defaultValue: 'darkblue',
      contextVariable: ['feature'],
    }

slot: thickness

    /**
     * !slot
     */
    thickness: {
      type: 'number',
      description: 'the thickness of the arcs',
      defaultValue: `jexl:logThickness(feature,'score')`,
      contextVariable: ['feature'],
    }

slot: label

    /**
     * !slot
     */
    label: {
      type: 'string',
      description: 'the label to appear at the apex of the arcs',
      defaultValue: `jexl:get(feature,'score')`,
      contextVariable: ['feature'],
    }

slot: height

    /**
     * !slot
     */
    height: {
      type: 'number',
      description: 'the height of the arcs',
      defaultValue: `jexl:log10(get(feature,'end')-get(feature,'start'))*50`,
      contextVariable: ['feature'],
    }

slot: caption

    /**
     * !slot
     */
    caption: {
      type: 'string',
      description:
        'the caption to appear when hovering over any point on the arcs',
      defaultValue: `jexl:get(feature,'name')`,
      contextVariable: ['feature'],
    }

LinearArcDisplay

slot: renderer

      /**
       * !slot
       */
      renderer: types.optional(
        pluginManager.pluggableConfigSchemaType('renderer'),
        { type: 'ArcRenderer' },
      )

derives from:

      /**
       * !baseConfiguration
       */
      baseConfiguration: baseLinearDisplayConfigSchema

OAuthConfigSchema

slot: tokenType

    /**
     * !slot
     */
    tokenType: {
      description: 'a custom name for a token to include in the header',
      type: 'string',
      defaultValue: 'Bearer',
    }

slot: authEndpoint

    /**
     * !slot
     */
    authEndpoint: {
      description: 'the authorization code endpoint of the internet account',
      type: 'string',
      defaultValue: '',
    }

slot: tokenEndpoint

    /**
     * !slot
     */
    tokenEndpoint: {
      description: 'the token endpoint of the internet account',
      type: 'string',
      defaultValue: '',
    }

slot: needsPKCE

    /**
     * !slot
     */
    needsPKCE: {
      description: 'boolean to indicate if the endpoint needs a PKCE code',
      type: 'boolean',
      defaultValue: false,
    }

slot: clientId

    /**
     * !slot
     */
    clientId: {
      description: 'id for the OAuth application',
      type: 'string',
      defaultValue: '',
    }

slot: scopes

    /**
     * !slot
     */
    scopes: {
      description: 'optional scopes for the authorization call',
      type: 'string',
      defaultValue: '',
    }

slot: responseType

    /**
     * !slot
     */
    responseType: {
      description: 'the type of response from the authorization endpoint',
      type: 'string',
      defaultValue: 'code',
    }

slot: hasRefreshToken

    /**
     * !slot
     */
    hasRefreshToken: {
      description: 'true if the endpoint can supply a refresh token',
      type: 'boolean',
      defaultValue: false,
    }

derives from:

    /**
     * !baseConfiguration
     */
    baseConfiguration: BaseInternetAccountConfig

DropboxOAuthConfigSchema

slot: authEndpoint

    /**
     * !slot
     */
    authEndpoint: {
      description: 'the authorization code endpoint of the internet account',
      type: 'string',
      defaultValue: 'https://www.dropbox.com/oauth2/authorize',
    }

slot: tokenEndpoint

    /**
     * !slot
     */
    tokenEndpoint: {
      description: 'the token endpoint of the internet account',
      type: 'string',
      defaultValue: 'https://api.dropbox.com/oauth2/token',
    }

slot: needsPKCE

    /**
     * !slot
     */
    needsPKCE: {
      description: 'boolean to indicate if the endpoint needs a PKCE code',
      type: 'boolean',
      defaultValue: true,
    }

slot: domains

    /**
     * !slot
     */
    domains: {
      description:
        'array of valid domains the url can contain to use this account',
      type: 'stringArray',
      defaultValue: [
        'addtodropbox.com',
        'db.tt',
        'dropbox.com',
        'dropboxapi.com',
        'dropboxbusiness.com',
        'dropbox.tech',
        'getdropbox.com',
      ],
    }

slot: hasRefreshToken

    /**
     * !slot
     */
    hasRefreshToken: {
      description: 'true if the endpoint can supply a refresh token',
      type: 'boolean',
      defaultValue: true,
    }

derives from:

    /**
     * !baseConfiguration
     */
    baseConfiguration: OAuthConfigSchema

ExternalTokenConfigSchema

slot: validateWithHEAD

    /**
     * !slot
     */
    validateWithHEAD: {
      description: 'validate the token with a HEAD request before using it',
      type: 'boolean',
      defaultValue: true,
    }

derives from:

    /**
     * !baseConfiguration
     */
    baseConfiguration: BaseInternetAccountConfig

GoogleDriveOAuthConfigSchema

slot: authEndpoint

    /**
     * !slot
     */
    authEndpoint: {
      description: 'the authorization code endpoint of the internet account',
      type: 'string',
      defaultValue: 'https://accounts.google.com/o/oauth2/v2/auth',
    }

slot: scopes

    /**
     * !slot
     */
    scopes: {
      description: 'optional scopes for the authorization call',
      type: 'string',
      defaultValue: 'https://www.googleapis.com/auth/drive.readonly',
    }

slot: domains

    /**
     * !slot
     */
    domains: {
      description:
        'array of valid domains the url can contain to use this account',
      type: 'stringArray',
      defaultValue: ['drive.google.com"'],
    }

slot: responseType

    /**
     * !slot
     */
    responseType: {
      description: 'the type of response from the authorization endpoint',
      type: 'string',
      defaultValue: 'token',
    }

derives from:

    /**
     * !baseConfiguration
     */
    baseConfiguration: OAuthConfigSchema

HTTPBasicConfigSchema

slot: tokenType

    /**
     * !slot
     */
    tokenType: {
      description: 'a custom name for a token to include in the header',
      type: 'string',
      defaultValue: 'Basic',
    }

slot: validateWithHEAD

    /**
     * !slot
     */
    validateWithHEAD: {
      description: 'validate the token with a HEAD request before using it',
      type: 'boolean',
      defaultValue: true,
    }

derives from:

    /**
     * !baseConfiguration
     */
    baseConfiguration: BaseInternetAccountConfig

BedAdapter

slot: bedLocation

    /**
     * !slot
     */
    bedLocation: {
      type: 'fileLocation',
      defaultValue: { uri: '/path/to/my.bed.gz', locationType: 'UriLocation' },
    }

slot: columnNames

    /**
     * !slot
     */
    columnNames: {
      type: 'stringArray',
      description: 'List of column names',
      defaultValue: [],
    }

slot: scoreColumn

    /**
     * !slot
     */
    scoreColumn: {
      type: 'string',
      description: 'The column to use as a "score" attribute',
      defaultValue: '',
    }

slot: autoSql

    /**
     * !slot
     */
    autoSql: {
      type: 'string',
      description: 'The autoSql definition for the data fields in the file',
      defaultValue: '',
    }

slot: colRef

    /**
     * !slot
     */
    colRef: {
      type: 'number',
      description: 'The column to use as a "refName" attribute',
      defaultValue: 0,
    }

slot: colStart

    /**
     * !slot
     */
    colStart: {
      type: 'number',
      description: 'The column to use as a "start" attribute',
      defaultValue: 1,
    }

slot: colEnd

    /**
     * !slot
     */
    colEnd: {
      type: 'number',
      description: 'The column to use as a "end" attribute',
      defaultValue: 2,
    }

BedTabixAdapter

slot: bedGzLocation

    /**
     * !slot
     */
    bedGzLocation: {
      type: 'fileLocation',
      defaultValue: { uri: '/path/to/my.bed.gz', locationType: 'UriLocation' },
    }

slot: index.indexType

      /**
       * !slot index.indexType
       */
      indexType: {
        model: types.enumeration('IndexType', ['TBI', 'CSI']),
        type: 'stringEnum',
        defaultValue: 'TBI',
      }

slot: index.location

      /**
       * !slot index.location
       */
      location: {
        type: 'fileLocation',
        defaultValue: {
          uri: '/path/to/my.bed.gz.tbi',
          locationType: 'UriLocation',
        },
      }

slot: columnNames

    /**
     * !slot
     */
    columnNames: {
      type: 'stringArray',
      description: 'List of column names',
      defaultValue: [],
    }

slot: scoreColumn

    /**
     * !slot
     */
    scoreColumn: {
      type: 'string',
      description: 'The column to use as a "score" attribute',
      defaultValue: '',
    }

slot: autoSql

    /**
     * !slot
     */
    autoSql: {
      type: 'string',
      description: 'The autoSql definition for the data fields in the file',
      defaultValue: '',
    }

BigBedAdapter

slot: bigBedLocation

    /**
     * !slot
     */
    bigBedLocation: {
      type: 'fileLocation',
      defaultValue: { uri: '/path/to/my.bb', locationType: 'UriLocation' },
    }

ChainAdapter

slot: assemblyNames

    /**
     * !slot
     */
    assemblyNames: {
      type: 'stringArray',
      defaultValue: [],
      description:
        'Target is the first value in the array, query is the second',
    }

slot: targetAssembly

    /**
     * !slot
     * can be specified as alternative to assemblyNames
     */
    targetAssembly: {
      type: 'string',
      defaultValue: '',
      description: 'Alternative to assemblyNames array: the target assembly',
    }

slot: queryAssembly

    /**
     * !slot
     * can be specified as alternative to assemblyNames
     */
    queryAssembly: {
      type: 'string',
      defaultValue: '',
      description: 'Alternative to assemblyNames array: the query assembly',
    }

slot: chainLocation

    /**
     * !slot
     */
    chainLocation: {
      type: 'fileLocation',
      defaultValue: { uri: '/path/to/file.chain', locationType: 'UriLocation' },
    }

DeltaAdapter

slot: assemblyNames

    /**
     * !slot
     */
    assemblyNames: {
      type: 'stringArray',
      defaultValue: [],
      description:
        'Array of assembly names to use for this file. The target assembly name is the first value in the array, query assembly name is the second',
    }

slot: targetAssembly

    /**
     * !slot
     * alternative to assembly names
     */
    targetAssembly: {
      type: 'string',
      defaultValue: '',
      description: 'Alternative to assemblyNames: the target assembly name',
    }

slot: queryAssembly

    /**
     * !slot
     * alternative to assembly names
     */
    queryAssembly: {
      type: 'string',
      defaultValue: '',
      description: 'Alternative to assemblyNames: the query assembly name',
    }

slot: deltaLocation

    /**
     * !slot
     */
    deltaLocation: {
      type: 'fileLocation',
      defaultValue: { uri: '/path/to/file.delta', locationType: 'UriLocation' },
    }

MCScanAnchorsAdapter

slot: mcscanAnchorsLocation

    /**
     * !slot
     */
    mcscanAnchorsLocation: {
      type: 'fileLocation',
      defaultValue: {
        uri: '/path/to/mcscan.anchors',
        locationType: 'UriLocation',
      },
    }

slot: bed1Location

    /**
     * !slot
     */
    bed1Location: {
      type: 'fileLocation',
      defaultValue: {
        uri: '/path/to/file.bed',
        locationType: 'UriLocation',
      },
    }

slot: bed2Location

    /**
     * !slot
     */
    bed2Location: {
      type: 'fileLocation',
      defaultValue: {
        uri: '/path/to/file.bed',
        locationType: 'UriLocation',
      },
    }

slot: assemblyNames

    /**
     * !slot
     */
    assemblyNames: {
      type: 'stringArray',
      defaultValue: [],
    }

MCScanSimpleAnchorsAdapter

slot: mcscanSimpleAnchorsLocation

    /**
     * !slot
     */
    mcscanSimpleAnchorsLocation: {
      type: 'fileLocation',
      defaultValue: {
        uri: '/path/to/mcscan.anchors.simple',
        locationType: 'UriLocation',
      },
    }

slot: bed1Location

    /**
     * !slot
     */
    bed1Location: {
      type: 'fileLocation',
      defaultValue: {
        uri: '/path/to/file.bed',
        locationType: 'UriLocation',
      },
    }

slot: bed2Location

    /**
     * !slot
     */
    bed2Location: {
      type: 'fileLocation',
      defaultValue: {
        uri: '/path/to/file.bed',
        locationType: 'UriLocation',
      },
    }

slot: assemblyNames

    /**
     * !slot
     */
    assemblyNames: {
      type: 'stringArray',
      defaultValue: [],
    }

MashMapAdapter

slot: assemblyNames

    /**
     * !slot
     */
    assemblyNames: {
      type: 'stringArray',
      defaultValue: [],
      description:
        'Target is the first value in the array, query is the second',
    }

slot: targetAssembly

    /**
     * !slot
     */
    targetAssembly: {
      type: 'string',
      defaultValue: '',
      description: 'Alternative to assemblyNames array: the target assembly',
    }

slot: queryAssembly

    /**
     * !slot
     */
    queryAssembly: {
      type: 'string',
      defaultValue: '',
      description: 'Alternative to assemblyNames array: the query assembly',
    }

slot: outLocation

    /**
     * !slot
     */
    outLocation: {
      type: 'fileLocation',
      defaultValue: {
        uri: '/path/to/mashmap.out',
        locationType: 'UriLocation',
      },
    }

PAFAdapter

slot: assemblyNames

    /**
     * !slot
     */
    assemblyNames: {
      type: 'stringArray',
      defaultValue: [],
      description:
        'Array of assembly names to use for this file. The target assembly name is the first value in the array, query assembly name is the second',
    }

slot: targetAssembly

    /**
     * !slot
     */
    targetAssembly: {
      type: 'string',
      defaultValue: '',
      description: 'Alternative to assemblyNames: the target assembly name',
    }

slot: queryAssembly

    /**
     * !slot
     */
    queryAssembly: {
      type: 'string',
      defaultValue: '',
      description: 'Alternative to assemblyNames: the query assembly name',
    }

slot: pafLocation

    /**
     * !slot
     */
    pafLocation: {
      type: 'fileLocation',
      defaultValue: {
        uri: '/path/to/file.paf',
        locationType: 'UriLocation',
      },
    }

FromConfigAdapter

slot: features

    /**
     * !slot
     */
    features: {
      type: 'frozen',
      defaultValue: [],
    }

slot: featureClass

    /**
     * !slot
     */
    featureClass: {
      type: 'string',
      defaultValue: 'SimpleFeature',
    }

FromConfigRegionsAdapter

used for specifying refNames+sizes of an assembly

slot: features

    /**
     * !slot
     */
    features: {
      type: 'frozen',
      defaultValue: [],
    }

slot: featureClass

    /**
     * !slot
     */
    featureClass: {
      type: 'string',
      defaultValue: 'SimpleFeature',
    }

FromConfigSequenceAdapter

slot: features

    /**
     * !slot
     */
    features: {
      type: 'frozen',
      defaultValue: [],
    }

slot: featureClass

    /**
     * !slot
     */
    featureClass: {
      type: 'string',
      defaultValue: 'SimpleFeature',
    }

RefNameAliasAdapter

slot: location

    /**
     * !slot
     */
    location: {
      type: 'fileLocation',
      defaultValue: {
        uri: '/path/to/my/aliases.txt',
        locationType: 'UriLocation',
      },
    }

slot: refNameColumn

    /**
     * !slot
     */
    refNameColumn: {
      type: 'number',
      defaultValue: 0,
    }

slot: color

    /**
     * !slot
     */
    color: {
      type: 'color',
      description:
        'the color of each feature in a synteny, used with colorBy:default',
      defaultValue: 'black',
      contextVariable: ['feature'],
    }

slot: posColor

    /**
     * !slot
     */
    posColor: {
      type: 'color',
      description: 'the color for forward alignments, used with colorBy:strand',
      defaultValue: 'blue',
    }

slot: negColor

    /**
     * !slot
     */
    negColor: {
      type: 'color',
      description: 'the color for reverse alignments, used with colorBy:strand',
      defaultValue: 'red',
    }

slot: lineWidth

    /**
     * !slot
     */
    lineWidth: {
      type: 'number',
      description: 'width of the lines to be drawn',
      defaultValue: 2.5, // 2.5 is similar to D-GENIES
    }

slot: colorBy

    /**
     * !slot
     */
    colorBy: {
      type: 'stringEnum',
      model: types.enumeration('colorBy', [
        'identity',
        'meanQueryIdentity',
        'mappingQuality',
        'strand',
        'default',
      ]),
      description: `Color by options:<br/>
<ul>
  <li>"identity" - the identity of the particular hit, similar to D-GENIES, use the other config slots 'thresholds' and 'thresholdsPalette' to define colors for this setting</li>
  <li>"meanQueryIdentity" - calculates the weighted mean identity (weighted by alignment length) of all the hits that the query maps to (e.g. if the query is split aligned to many target, uses their weighted mean. can help show patterns of more related and distant synteny after WGD)</li>
  <li>"mappingQuality" - uses mapping quality from PAF, some adapters don't have this setting</li>
  <li>"strand" - colors negative alignments with negColor and positive alignments with posColor</li>
  <li>"default" - uses the 'color' config slot</li>
</ul>`,
      defaultValue: 'default',
    }

slot: thresholdsPalette

    /**
     * !slot
     */
    thresholdsPalette: {
      type: 'stringArray',
      defaultValue: ['#094b09', '#2ebd40', '#d5670b', '#ffd84b'],
      description: 'threshold colors, used with colorBy:identity',
    }

slot: thresholds

    /**
     * !slot
     */
    thresholds: {
      type: 'stringArray',
      defaultValue: ['0.75', '0.5', '0.25', '0'],
      description: 'threshold breakpoints, used with colorBy:identity',
    }

Gff3Adapter

slot: gffLocation

    /**
     * !slot
     */
    gffLocation: {
      type: 'fileLocation',
      defaultValue: { uri: '/path/to/my.gff', locationType: 'UriLocation' },
    }

Gff3TabixAdapter

slot: gffGzLocation

    /**
     * !slot
     */
    gffGzLocation: {
      type: 'fileLocation',
      defaultValue: { uri: '/path/to/my.gff.gz', locationType: 'UriLocation' },
    }

slot: index.indexType

      /**
       * !slot index.indexType
       */
      indexType: {
        model: types.enumeration('IndexType', ['TBI', 'CSI']),
        type: 'stringEnum',
        defaultValue: 'TBI',
      }

slot: index.indexType

      /**
       * !slot index.indexType
       */
      location: {
        type: 'fileLocation',
        defaultValue: {
          uri: '/path/to/my.gff.gz.tbi',
          locationType: 'UriLocation',
        },
      }

slot: dontRedispatch

    /**
     * !slot
     * the Gff3TabixAdapter has to "redispatch" if it fetches a region and
     * features it finds inside that region extend outside the region we requested.
     * you can disable this for certain feature types to avoid fetching e.g. the
     * entire chromosome
     */
    dontRedispatch: {
      type: 'stringArray',
      defaultValue: ['chromosome', 'region'],
    }

GtfAdapter

slot: gtfLocation

    /**
     * !slot
     */
    gtfLocation: {
      type: 'fileLocation',
      defaultValue: { uri: '/path/to/my.gtf', locationType: 'UriLocation' },
    }

HicAdapter

slot: hicLocation

    /**
     * !slot
     */
    hicLocation: {
      type: 'fileLocation',
      defaultValue: {
        uri: '/path/to/my.hic',
        locationType: 'UriLocation',
      },
    }

HicRenderer

slot: baseColor

    /**
     * !slot
     */
    baseColor: {
      type: 'color',
      description: 'base color to be used in the hic alignment',
      defaultValue: '#f00',
    }

slot: color

    /**
     * !slot
     */
    color: {
      type: 'color',
      description: 'the color of each feature in a hic alignment',
      defaultValue: `jexl:colorString(hsl(alpha(baseColor,min(1,count/(maxScore/20)))))`,
      contextVariable: ['count', 'maxScore', 'baseColor'],
    }

slot: maxHeight

    /**
     * !slot
     */
    maxHeight: {
      type: 'integer',
      description: 'the maximum height to be used in a hic rendering',
      defaultValue: 600,
    }

LinearHicDisplay

slot: renderer

      /**
       * !slot
       */
      renderer: pluginManager.getRendererType('HicRenderer').configSchema

derives from:

      /**
       * !baseConfiguration
       */
      baseConfiguration: baseLinearDisplayConfigSchema

ReferenceSequenceTrack

used to display base level DNA sequence tracks

slot: adapter

      /**
       * !slot adapter
       * !type AdapterType
       * configuration for track adapter
       */
      adapter: pluginManager.pluggableConfigSchemaType('adapter')

slot: displays

      /**
       * !slot displays
       * !type DisplayType[]
       * configuration for the displays e.g. LinearReferenceSequenceDisplay
       */
      displays: types.array(pluginManager.pluggableConfigSchemaType('display'))

slot: name

      /**
       * !slot name
       */
      name: {
        type: 'string',
        description:
          'optional track name, otherwise uses the "Reference sequence (assemblyName)"',
        defaultValue: '',
      }

slot: metadata

      /**
       * !slot metadata
       */
      metadata: {
        type: 'frozen',
        description: 'anything to add about this track',
        defaultValue: {},
      }

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Oct 18, 2022
@cmdcolin cmdcolin added documentation and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Oct 18, 2022
@cmdcolin
Copy link
Collaborator Author

note: only picks up "true" doc strings with block comment format and two asterisk to start it

/** must have two stars here
 *
 */

@cmdcolin
Copy link
Collaborator Author

now has examples for auto-documenting state models, so both config models and state models are addressed

example

Screenshot from 2022-10-18 16-43-32

@cmdcolin cmdcolin force-pushed the generate_docs branch 6 times, most recently from 724c9b0 to 4201578 Compare October 19, 2022 04:15
@cmdcolin cmdcolin force-pushed the generate_docs branch 2 times, most recently from 47a9a59 to b14e7e3 Compare October 19, 2022 05:31
@cmdcolin cmdcolin marked this pull request as ready for review October 19, 2022 05:34
@cmdcolin cmdcolin force-pushed the generate_docs branch 2 times, most recently from c285a61 to d746288 Compare October 19, 2022 19:41
@codecov
Copy link

codecov bot commented Oct 22, 2022

Codecov Report

Merging #3278 (31f6877) into main (821c85f) will decrease coverage by 0.39%.
The diff coverage is 74.33%.

❗ Current head 31f6877 differs from pull request most recent head 3a0e2df. Consider uploading reports for the commit 3a0e2df to get more accurate results

@@            Coverage Diff             @@
##             main    #3278      +/-   ##
==========================================
- Coverage   59.69%   59.29%   -0.40%     
==========================================
  Files         675      733      +58     
  Lines       28735    29009     +274     
  Branches     6981     7048      +67     
==========================================
+ Hits        17153    17201      +48     
- Misses      11338    11531     +193     
- Partials      244      277      +33     
Impacted Files Coverage Δ
packages/core/data_adapters/CytobandAdapter.ts 38.46% <0.00%> (-3.21%) ⬇️
...leElementTypes/models/baseInternetAccountConfig.ts 100.00% <ø> (ø)
...re/pluggableElementTypes/models/baseTrackConfig.ts 58.33% <ø> (ø)
packages/core/rpc/configSchema.ts 25.00% <0.00%> (-41.67%) ⬇️
packages/core/util/layouts/GranularRectLayout.ts 88.74% <ø> (ø)
packages/core/util/simpleFeature.ts 84.90% <ø> (ø)
packages/core/util/stats.ts 96.15% <ø> (ø)
packages/text-indexing/src/util.ts 14.28% <ø> (ø)
plugins/alignments/src/CramAdapter/index.ts 100.00% <ø> (ø)
...lignments/src/HtsgetBamAdapter/HtsgetBamAdapter.ts 0.00% <0.00%> (ø)
... and 160 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cmdcolin cmdcolin force-pushed the generate_docs branch 2 times, most recently from d372001 to 421a56c Compare October 22, 2022 22:49
@cmdcolin cmdcolin force-pushed the generate_docs branch 4 times, most recently from 2b8d189 to 47fc0dc Compare October 26, 2022 20:31
@cmdcolin cmdcolin merged commit df51d3d into main Oct 26, 2022
@cmdcolin cmdcolin deleted the generate_docs branch October 26, 2022 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

autogenerated configuration docs
1 participant