File: wig.h

package info (click to toggle)
phast 1.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 12,412 kB
  • sloc: ansic: 54,180; makefile: 354; sh: 337; perl: 321
file content (56 lines) | stat: -rw-r--r-- 2,423 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/***************************************************************************
 * PHAST: PHylogenetic Analysis with Space/Time models
 * Copyright (c) 2002-2005 University of California, 2006-2010 Cornell 
 * University.  All rights reserved.
 *
 * This source code is distributed under a BSD-style license.  See the
 * file LICENSE.txt for details.
 ***************************************************************************/

/** @file gff.h
    Reading and writing of sequence features in wig format. 
    Obeys file specification at
    http://genome.ucsc.edu/goldenPath/help/wiggle.html
    @ingroup feature
*/


#ifndef WIG_H
#define WIG_H

#include <gff.h>


/** Check if a string is a wig file header and parse the arguments.
    @param line[in] A string which may be a wig header file (fixed or variable step)
    @param fixed[out] If not NULL, will be set to 1 if line is a header for a fixedStep wig, 
      and 0 if line is  header for a variableStep wig.  Will not be set if line is not a wig 
      header.  If not NULL, must be allocated large enough to hold the chrom value.
    @param chrom[out] If not NULL, will be set to the chrom argument in a wig header.  Will 
      not be set if line is not a wig header.
    @param start[out] Will be set to the start argument if line is a fixedStep wig header.
    @param step[out] Will be set to the step argument if line is a fixedStep wig header
    @param span[out] Will be set to the span argument if line is a wig header.  If line is a 
      wig header but span is not given, it will be set to the default value of 1.  Will not 
      be set if line is not a wig header.
    @return 1 if line is a wig header, 0 otherwise.  None 
 */
int wig_parse_header(String *line, int *fixed, char *chrom, int *start, int *step, int *span);

/** Read a wig file and store as a GFF.  Can read either fixed or variable wig files.
  @param F wig file to read
  @return A newly allocated GFF set populated with the data from the wig file.
  @note although not technically allowed in the specification, this function will accept a wig
  file with a mix of fixed/variable sections.
 */
GFF_Set *gff_read_wig(FILE *F);

/** Write a GFF object as a fixedStep wig file.
  @param F file stream to write to
  @param set The GFF set to write.
  @note all elements in set must have the same length and have a defined score.
 */
void wig_print(FILE *outfile, GFF_Set *set);

#endif