This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program gc; | |
uses | |
Sysutils; | |
var | |
FastaFile: TextFile; | |
CurrentLine: String; | |
GCCount: LongInt; | |
ATCount: LongInt; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program gc; | |
{$mode objfpc} // Do not forget this ever | |
uses | |
Sysutils; | |
var | |
FastaFile: TextFile; | |
CurrentLine: String; | |
GCCount: Integer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
import std.string; | |
import std.algorithm; | |
import std.regex; | |
void main() { | |
File file = File("Homo_sapiens.GRCh37.67.dna_rm.chromosome.Y.fa","r"); | |
int gcCount = 0; | |
int atCount = 0; | |
int totalBaseCount = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <fstream> | |
#include <iostream> | |
int main() { | |
std::fstream fs("Homo_sapiens.GRCh37.67.dna_rm.chromosome.Y.fa", std::ios::in); | |
int a = 0; | |
int t = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
char buf[1000]; | |
int gc=0; | |
int at=0; | |
FILE *f=fopen("Homo_sapiens.GRCh37.67.dna_rm.chromosome.Y.fa","r"); | |
while (fgets(buf,1000,f)) | |
if (*buf!='>') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <assert.h> | |
int main() { | |
FILE * inputFile = fopen( "Homo_sapiens.GRCh37.67.dna_rm.chromosome.Y.fa", "rb" ); | |
size_t gcCount = 0; | |
size_t atCount = 0; | |
for ( char c; (c = fgetc_unlocked( inputFile )) != EOF; ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
file = open("Homo_sapiens.GRCh37.67.dna_rm.chromosome.Y.fa","rb") | |
gcCount = 0 | |
atCount = 0 | |
while 1: | |
lines = file.readlines(10000) | |
if not lines: | |
break | |
for line in lines: | |
if line and not line[0] == ">": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
file = open("Homo_sapiens.GRCh37.67.dna_rm.chromosome.Y.fa","rb") | |
gcCount = 0 | |
atCount = 0 | |
while 1: | |
lines = file.readlines(1000) | |
if not lines: | |
break | |
for line in lines: | |
if line and not line[0] == ">": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define MAXFLEN 70000000 /* Larger than the file. */ | |
int main() | |
{ | |
char *m=malloc(MAXFLEN); | |
int gc=0; | |
int at=0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define MAXFLEN 70000000 /* Larger than the file. */ | |
int main() | |
{ | |
char *m=malloc(MAXFLEN); | |
char tablegc[256]; | |
char tableat[256]; |