This file is indexed.

/usr/share/doc/staden-io-lib/test/scram.test is in staden-io-lib-examples 1.13.7-1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 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
75
76
77
78
79
80
81
82
83
#!/bin/sh

$srcdir/generate_data.pl || exit 1

scramble="${VALGRIND} /usr/bin/scramble ${SCRAMBLE_ARGS}"
compare_sam=$srcdir/compare_sam.pl

#valgrind="valgrind --leak-check=full"
#scramble="$valgrind $scramble"

# fast cmp that does large blocks to avoid disk thrashing
#cmp=fcmp
cmp=cmp

case $# in
    0) files=`/bin/ls $srcdir/data/*.sam | egrep -v '\.(full|sub)\.'`
       ;;
    *) files=${@+"$@"}
       ;;
esac

for i in $files
do
    ref=`echo $i | sed 's/#.*/.fa/'`
    root=`echo $i | sed 's/\.sam$//;s:.*/::'`
    echo "=== testing $root.sam ==="

    # Create BAM
    echo "$scramble $i $outdir/$root.bam"
    $scramble $i $outdir/$root.bam

    # Create CRAM
    echo "$scramble -r $ref $outdir/$root.bam $outdir/$root.full.cram"
    $scramble -r $ref $outdir/$root.bam $outdir/$root.full.cram

    # Test conversion back to SAM 
    echo "$scramble $outdir/$root.bam > $outdir/tmp.sam"
    $scramble $outdir/$root.bam > $outdir/tmp.sam
    $compare_sam $srcdir/data/$root.sam $outdir/tmp.sam || exit 1

    echo "$scramble $outdir/$root.full.cram > $outdir/$root.full.sam"
    $scramble $outdir/$root.full.cram > $outdir/$root.full.sam
    $compare_sam --nomd --unknownrg $srcdir/data/$root.sam $outdir/$root.full.sam || exit 1

    echo "$scramble -O bam $outdir/$root.full.cram > $outdir/$root.full.bam"
    $scramble -O bam $outdir/$root.full.cram > $outdir/$root.full.bam
    echo "$scramble $outdir/$root.full.bam $outdir/tmp.sam"
    $scramble $outdir/$root.full.bam $outdir/tmp.sam;
    sed '/^@PG.*scramble\.3.*/d;s/\(^@PG.*scramble.*\) -O bam/\1/' $outdir/tmp.sam > $outdir/$root.full.bam.sam
    rm $outdir/tmp.sam
    echo "$cmp $outdir/$root.full.sam $outdir/$root.full.bam.sam"
    $cmp $outdir/$root.full.sam $outdir/$root.full.bam.sam || exit 1


    # Try again with embedded ref; skip for unsorted sams
    case "$root" in
    *"unsorted") #skip
        ;;
    *) 
        echo "$scramble -X -r $ref $outdir/$root.bam $outdir/$root.full.cram"
        $scramble -r $ref $outdir/$root.bam $outdir/$root.full.cram
        
        echo "$scramble $outdir/$root.full.cram > $outdir/$root.full.sam"
        $scramble $outdir/$root.full.cram > $outdir/$root.full.sam
        $compare_sam --nomd --unknownrg $srcdir/data/$root.sam $outdir/$root.full.sam || exit 1
        echo "$cmp $outdir/$root.full.sam $outdir/$root.full.bam.sam"
        $cmp $outdir/$root.full.sam $outdir/$root.full.bam.sam || exit 1
	;;
    esac


    # And again with no ref.
    echo "$scramble -x -r $ref $outdir/$root.bam $outdir/$root.full.cram"
    $scramble -r $ref $outdir/$root.bam $outdir/$root.full.cram

    echo "$scramble $outdir/$root.full.cram > $outdir/$root.full.sam"
    $scramble $outdir/$root.full.cram > $outdir/$root.full.sam
    $compare_sam --nomd --unknownrg $srcdir/data/$root.sam $outdir/$root.full.sam || exit 1
    echo "$cmp $outdir/$root.full.sam $outdir/$root.full.bam.sam"
    $cmp $outdir/$root.full.sam $outdir/$root.full.bam.sam || exit 1

    echo ""
done