craw_coverage

craw_coverage.py is the entry point script to compute coverage.

craw.scripts.craw_coverage.get_result_header(annot_parser, parsed_args)[source]

Compute the header for the results. the firts lines start with # they contains some general information about the craw (version) and options used (for tracbility) the last line is the header of columns separated by –sep option and can be used as header with pandas

Parameters
  • annot_parser (annotation.AnnotationParser object) – the annotation parser

  • parsed_args (argparse.Namespace) – the command line argument parsed with argparse

Returns

The header of the result file

Return type

str

craw.scripts.craw_coverage.get_results_file(sense_opt, basename, suffix)[source]
Parameters
  • sense_opt (str) –

    how to managed the sense and antisense results

    • mixed: sense and antisense are interleaved in same file

    • split: sense and antisense are in separated files

    • S: only sense results are write down

    • AS: only antisense are write down

  • basename (str) – the basename of the results file

  • suffix (str) – the suffix of the results file

Returns

the file objects where to write sense and antisense results

Return type

tuple (file object sense, file object antisense)

craw.scripts.craw_coverage.get_version_message()[source]
Returns

The human readable CRAW version.

Return type

str

craw.scripts.craw_coverage.main(args=None, log_level=None)[source]

The entrypoint for craw_coverage script It will generate a coverage matrix around the position of interest and write the results in files

Parameters
  • args (list of string as given by sys.argv without the program name) – the arguments and options given on the command line

  • log_level (positive int or logging flag logging.DEBUG, logging.INFO, logging.ERROR, logging.CRITICAL) – the level of logger

craw.scripts.craw_coverage.parse_args(args)[source]
Parameters

args (list of string) – The options set on the command line (without the program name)

Returns

craw.scripts.craw_coverage.positive_int(value)[source]

Parse value given by the parser

Parameters

value (string) – the value given by the parser

Returns

the integer corresponding to the value

Return type

int

Raise

argparse.ArgumentTypeError

craw.scripts.craw_coverage.quality_checker(value)[source]

Parse value given by the parser

Parameters

value (string) – the value given by the parser

Returns

the integer >=0 and <=42 corresponding to the value

Return type

int

Raise

argparse.ArgumentTypeError if value does not represent a integer >=0 and <=42