---
# System prepended metadata

title: BI278 Lab#1 Notes

---

# BI278 Lab#1 Notes

## Exercise#1

Used `ssh khirat24@bi278` to connect to the computer server
Used colby email password to log in
When logging out, use the command exit to disconnect

```
pwd #shows you where you are
ls #shows you all the directories of where you are
cd #lets you move around such as cd colbyhome gets you to colbyhome, cd home gets back you to ~ (home)
```

### exercise 1.3
used `mkdir lab_01a lab_01b` to make new directories lab_01a and lab_01b
used `cp /courses/bi278/Course_Materials/lab_01a/* ./lab_01a` to copy file of Course Materials into lab_01a
`cd lab_01a` to move into the directory
used `mkdir raw_preference` to create a new file within lab_01a
used `mv` command to move each file that starts with raw_preference_ to the newly made file raw_preference
For example `mv raw_preference_agilis_backcross.txt raw_preference` to ,move the first file into raw_preference file
next, used `mkdir figures` to create new file, and used`mv` command to move each file starting with fig# into `figures`

## Exercise 2
Used `ls /courses/bi278/Course_Materials/ lab_01b/` to view the content in the directory
Used `grep ">" /courses/bi278/Course_Materials/lab_01b/GCF_000756045.1_ASM75604v1_genomic.fna` to look at the file, which tells me that this file has three chromosomes with complete sequence

Next to the name of the organism, there is a strain number
When counting contig count, count the number of header

| Organism       | Strain  | Contig count | Genome size (bp) | GC % |
| -------------- | ------- | ------------ | ---------------- | ---- |
| P.	agricolaris | baqs159 | 2 |      8721420     | 62  |
| P.	bonniea     | bbqs859 |2 |                4098182  |  59    |
| P.	bonniea     | bbqs395 | 2 | 4009285                 |   59   |
| P. bonniea     | bbqs433 | 2 |                4013203  |    59  |
| P.fungorum | ATCC BAA-463 | 4 | 9058983                 |  62    |
| P.hayleyella   | bhqs11 | 2 |  4125700    |   59   |
| P.hayleyella   | bhqs155 | 2 |  2439862  |  59    |
| P.hayleyella   | bhqs171 | 35 |  4088457   |  59  |
| P.hayleyella   | bhqs21 | 35 | 4088512                 | 59     |
| P.hayleyella   | bhqs22 | 45 |  4084312                |  59    |
| P.hayleyella   | bhqs23 | 36 |  4090401 | 59     |
| P.hayleyella   | bhqa530 | 2 |  4118722                |   59   |
| P.hayleyella   | bhqs69 | 2 | 4125852 | 59     |
| P.sprentiae | WSM5005 | 5 | 7829542                 |  63    |
| P.terrae | DSM17804 | 4 |  10062489                |   62   |
| P.xenovorans | LB400 | 3 | 9702951                 |   63   |

In the file test.fa, I used `grep ">" /courses/bi278/Course_Materials/lab_01b/test.fa` to find all the results wiht > on it, which only brought out >test - it didnt work
Next, I used `grep -v ">" /courses/bi278/Course_Materials/lab_01b/test.fa`, and it showed all the bases. This means that adding `-v` to `grep ">"` shows the ones without > in front of it.
Then, I used `grep -v ">" /courses/bi278/Course_Materials/lab_01b/test.fa | tr -d -c GCgc`, which shows only Gs and Cs of the all bases.
Finally, I used `grep -v ">" /courses/bi278/Course_Materials/lab_01b/test.fa | tr -d -c GCgc | wc -c` to count all the Gs and Cs. Use `grep -v ">" /courses/bi278/Course_Materials/lab_01b/test.fa | tr -d -c GCgcATat | wc -c` to count the whole bases.

go into nano by typing in `nano`
In nano, type in #!/bin/bash, then type in the three commands I used to get the counting, which are `grep -v ">"`, `grep -v ">"...| tr -d -c GCgc`, and `grep -v ">"...| tr -d -c GCgc | wc -c`
Save it by exisiting out, Inamed it as basecounting.sh
Make sure to save it to the personal directory and not the course directory. Also make sure to add .sh at the end in order to properly be able to run it
Reopen `nano basecounting.sh`
Change your filename in	each line (test.fa)	to $1 and exit out,	while saving with different name. I saved as speedcounting.sh
Open `sh basecounting.sh speedcounting.sh`