Skip to content

Commit

Permalink
update on test.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
tgaspe committed Aug 7, 2024
1 parent da6e11f commit bac80a5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/bedtools/bedtools_genomecov/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,34 @@ assert_identical_content() {
echo "Creating Test Data..."
mkdir -p test_data

# create input files

# create expected output files
# Create and populate input files
printf "chr1\t248956422\nchr3\t242193529\nchr2\t198295559\n" > "test_data/genome.txt"
printf "chr2:172936693-172938111\t128\t228\tmy_read/1\t37\t+\nchr2:172936693-172938111\t428\t528\tmy_read/2\t37\t-\n" > "test_data/example.bed"
printf "chr2:172936693-172938111\t128\t228\tmy_read/1\t60\t+\t128\t228\t255,0,0\t1\t100\t0\nchr2:172936693-172938111\t428\t528\tmy_read/2\t60\t-\t428\t528\t255,0,0\t1\t100\t0\n" > "test_data/example.bed12"
# Create and populate example.gff file
printf "##gff-version 3\n" > "test_data/example.gff"
printf "chr1\t.\tgene\t1000\t2000\t.\t+\t.\tID=gene1;Name=Gene1\n" >> "test_data/example.gff"
printf "chr3\t.\tmRNA\t1000\t2000\t.\t+\t.\tID=transcript1;Parent=gene1\n" >> "test_data/example.gff"
printf "chr1\t.\texon\t1000\t1200\t.\t+\t.\tID=exon1;Parent=transcript1\n" >> "test_data/example.gff"
printf "chr2\t.\texon\t1500\t1700\t.\t+\t.\tID=exon2;Parent=transcript1\n" >> "test_data/example.gff"
printf "chr1\t.\tCDS\t1000\t1200\t.\t+\t0\tID=cds1;Parent=transcript1\n" >> "test_data/example.gff"
printf "chr1\t.\tCDS\t1500\t1700\t.\t+\t2\tID=cds2;Parent=transcript1\n" >> "test_data/example.gff"


# Test 1:
mkdir test1
cd test1

echo "> Run bedtools_genomecov on BED file"
# "$meta_executable" \
# --input_a "../test_data/featuresA.bed" \
# --input_b "../test_data/featuresB.bed" \
# --output "output.bed"
"$meta_executable" \
--input "../test_data/example.bed" \
--genome "../test_data/genome.txt" \
--output "output.bed"

# checks
assert_file_exists "output.bed"
assert_file_not_empty "output.bed"
assert_identical_content "output.bed" "../test_data/expected_default.bed"
#assert_identical_content "output.bed" "../test_data/expected_default.bed"
echo "- test1 succeeded -"

cd ..
Expand Down
2 changes: 2 additions & 0 deletions src/bedtools/bedtools_genomecov/test_data/example.bed
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
chr2 128 228 my_read/1 37 +
chr2 428 528 my_read/2 37 -
3 changes: 3 additions & 0 deletions src/bedtools/bedtools_genomecov/test_data/genome.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
chr1 248956422
chr2 198295559
chr3 242193529

0 comments on commit bac80a5

Please sign in to comment.