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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
# import pytest
# from io import StringIO
# import pyranges as pr
# from pyranges.guessers import (parse_file, guess_columns, guess_chromosome, guess_strand, guess_start_end, guess_delim)
# @pytest.fixture
# def bed_df():
# return pr.data.chipseq().df
# @pytest.fixture
# def bed_file():
# return pr.get_example_path("chipseq") + ".bed"
# @pytest.fixture
# def gtf_file():
# return pr.get_example_path("ensembl.gtf")
# @pytest.fixture
# def number_unique(bed_df):
# number_unique = {c: len(bed_df[c].unique()) for c in bed_df}
# return number_unique
# def test_guess_delim(gtf_file):
# delim = guess_delim(gtf_file).encode()
# assert delim == " ".encode() # this is the wrong guess
# def test_guess_strand(bed_df, number_unique):
# result = guess_strand(bed_df, number_unique, "Start", "End")
# assert result == "Strand"
# def test_guess_start_end(bed_df, number_unique):
# result = guess_start_end(bed_df, number_unique)
# assert result == ("Start", "End")
# def test_guess_chromosome(bed_df, number_unique):
# result = guess_chromosome(bed_df, number_unique, "Strand")
# assert result == "Chromosome"
# def test_guess_columns(bed_file):
# result = guess_columns(bed_file)
# assert result == (0, 1, 2, 5)
# def test_guess_columns(gtf_file):
# result = guess_columns(gtf_file, sep="\t", header=False)
# print(result)
# assert result == (0, 1, 2, 5)
|