<commit_before>Instructions for FindInsertSeq.pl

Software required in PATH:
SAMtools (Tested with Version: 0.1.19-44428cd but shouldn't be an issue which version you have)
Bowtie2 (Any version should be fine)


Open up linux command line (contact your IT support if you are unsure how to do this):

Go to: https://github.com/Rothamsted/AppliedBioinformatics

Click on "download ZIP" which is on the right of the screen and put it in a location of your choice i.e. /home/data/rking/


unzip the file to a location of your choice, for example

cd /home/data/rking
unzip [download filename].zip


Go to the location where the FindInsertSeq folder is:

cd [download filename]/FindInsertSeq

Get the sample data files from below and place in the FindSeq directory below. Please note these files have been reduced to 10% the original size but are still 600 Mb total. Please use this file if able because it's important to retain coverage across the plasmid and genomic sequence to demonstrate the observation of plasmid insertion copy number by comparison with the genomic coverage and that there were no large scale deletions events across the genome using this example.
https://rrescloud.rothamsted.ac.uk/public.php?service=files&t=6b600b040d42a3e31f126da37119d01d
A further smaller file is available here however this will just test the insertion point and plasmid coverage as I filtered the reads that map to the plasmid.
https://rrescloud.rothamsted.ac.uk/public.php?service=files&t=c12fcf15ca672a2fade4eb5a426b5950

The larger file download link will contain: Reads.txt file which contains your set of paired read filenames separated by a comma, and sample data "3002subR1_25.fastq", "3002subR2_25.fastq", "plasmid1.fasta", "RRes_GZ.fasta".
The smaller file download link will contain: Reads.txt file which contains your set of paired read filenames separated by a comma, and sample data "3002subR1_small.fastq", "3002subR2_small.fastq", "plasmid1.fasta", "RRes_GZ.fasta".

Open the "Reads.txt" file and you will see the names of the left and right fastq files separated by a comma that matches the sample data. If you change this file by adding additional or different paired data in windows make sure it is in linux format by doing a "dos2unix Reads.txt".

Run the FindInsertSeq script by typing:
[The script] [plasmid sequence] [genomic reference sequence]
./FindInsertSeq.pl plasmid1.fasta RRes_GZ.fasta bowtie

The end output will print to the screen the mapped genomic reads in coordinate sorted order so you can visually identify where the insertion points are by a number of reads of similar positions (cluster or stack). The output is also printed to a file too if you look in the folder. 

Example output for the sample data is:
****PAIRED READ SET 3002sub1R1_25.fastq.sam COMPLETED****

Chromosome_4    1518752<commit_msg>Update README.txt<commit_after>Instructions for FindInsertSeq.pl

Software required in PATH:
SAMtools (Tested with Version: 0.1.19-44428cd but shouldn't be an issue which version you have)
Bowtie2 (Any version should be fine)


Open up linux command line (contact your IT support if you are unsure how to do this):

Go to: https://github.com/Rothamsted/AppliedBioinformatics

Click on "download ZIP" which is on the right of the screen and put it in a location of your choice i.e. /home/data/rking/


unzip the file to a location of your choice, for example

cd /home/data/rking
unzip [download filename].zip


Go to the location where the FindInsertSeq folder is:

cd [download filename]/FindInsertSeq

Get the sample data files from below and place in the FindSeq directory below. Please note these files have been reduced to 10% the original size but are still 600 Mb total. Please use this file if able because it's important to retain coverage across the plasmid and genomic sequence to demonstrate the observation of plasmid insertion copy number by comparison with the genomic coverage and that there were no large scale deletions events across the genome using this example.
https://rrescloud.rothamsted.ac.uk/public.php?service=files&t=6b600b040d42a3e31f126da37119d01d
A further smaller file is available here however this will just test the insertion point and plasmid coverage as I filtered the reads that map to the plasmid.
https://rrescloud.rothamsted.ac.uk/public.php?service=files&t=c12fcf15ca672a2fade4eb5a426b5950

Put either the small or larger dataset into the same folder that contains the Reads.txt file "/FindInsertSeq directory/test_data/"
The larger file download link will contain: sample data "3002subR1_25.fastq", "3002subR2_25.fastq", "plasmid1.fasta", "RRes_GZ.fasta".
The smaller file download link will contain: sample data "3002subR1_small.fastq", "3002subR2_small.fastq", "plasmid1.fasta", "RRes_GZ.fasta".

Open the "Reads.txt" file and you will see the names of the left and right fastq files separated by a comma that matches the sample data. If you change this file by adding additional or different paired data in windows make sure it is in linux format by doing a "dos2unix Reads.txt".
If using the small data set change the Reads.txt file to:
3002subR1_small.fastq,3002subR2_small.fastq

Run the FindInsertSeq script by typing:
[The script] [plasmid sequence] [genomic reference sequence]
./FindInsertSeq.pl plasmid1.fasta RRes_GZ.fasta bowtie

The end output will print to the screen the mapped genomic reads in coordinate sorted order so you can visually identify where the insertion points are by a number of reads of similar positions (cluster or stack). The output is also printed to a file too if you look in the folder. 

Example output for the sample data is:
****PAIRED READ SET 3002sub1R1_25.fastq.sam COMPLETED****

Chromosome_4    1518752
{'fraction_non_alphanumeric': 0.05240174672489083, 'fraction_numerical': 0.0359825327510917, 'mean_word_length': 4.878850102669404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2848622', 'n_tokens_mistral': 1777, 'n_tokens_neox': 1584, 'n_words': 798}