Commit df4d3e34 authored by sauloal's avatar sauloal
Browse files

first

parents
*.fa
*.sizes
*.bb
*_static*
The MIT License (MIT)
Copyright (c) 2016 Saulo Aflitos
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Uses github.com:sauloal/kentjs.git
#!/bin/bash
set -xeu
DIR=/PWD/
#${PWD}
#DIR=http://localhost:8000
FA=${DIR}S_lycopersicum_chromosomes.2.50.fa
BED=${DIR}exp_refineFinal1_merged_r.cmap.bed
BIGBED=${BED/.bed/.bb}
SIZES=${FA}.sizes
#if [[ ! -f "${SIZES}" ]]; then
# ./gen_sizes.py ${FA}
#fi
#./bedToBigBed_static -tab ${BED} ${SIZES} ${BIGBED}
ENVIRONMENT=NONE node bedToBigBed_static.js -tab ${BED} ${SIZES} ${BIGBED}
#!/usr/bin/env python
import os
import sys
def main():
infile = sys.argv[1]
oufile = infile + '.sizes'
data = []
with open(infile, 'r') as fhd:
for line in fhd:
line = line.strip()
if len(line) == 0:
continue
if line[0] == ">":
chrom_name = line[1:].split(" ")[0]
data.append([ chrom_name, 0 ])
else:
data[-1][1] += len(line)
with open(oufile, 'w') as fhd:
for chrom_name, chrom_len in data:
print chrom_name, chrom_len
fhd.write("%s %d\n"%(chrom_name, chrom_len))
if __name__ == "__main__":
main()
#browser position chr7:127471196-127495720
#browser hide all
#track name="ItemRGBDemo" description="Item RGB demonstration" visibility=2 itemRgb="On"
chr7 127471196 127472363 Pos1 0 + 127471196 127472363 255,0,0
chr7 127472363 127473530 Pos2 0 + 127472363 127473530 255,0,0
chr7 127473530 127474697 Pos3 0 + 127473530 127474697 255,0,0
chr7 127474697 127475864 Pos4 0 + 127474697 127475864 255,0,0
chr7 127475864 127477031 Neg1 0 - 127475864 127477031 0,0,255
chr7 127477031 127478198 Neg2 0 - 127477031 127478198 0,0,255
chr7 127478198 127479365 Neg3 0 - 127478198 127479365 0,0,255
chr7 127479365 127480532 Pos5 0 + 127479365 127480532 255,0,0
chr7 127480532 127481699 Neg4 0 - 127480532 127481699 0,0,255
#browser position chr7:127471196-127495720
#browser hide all
#track name="ColorByStrandDemo" description="Color by strand demonstration" visibility=2 colorByStrand="255,0,0 0,0,255"
chr7 127471196 127472363 Pos1 0 +
chr7 127472363 127473530 Pos2 0 +
chr7 127473530 127474697 Pos3 0 +
chr7 127474697 127475864 Pos4 0 +
chr7 127475864 127477031 Neg1 0 -
chr7 127477031 127478198 Neg2 0 -
chr7 127478198 127479365 Neg3 0 -
chr7 127479365 127480532 Pos5 0 +
chr7 127480532 127481699 Neg4 0 -
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment