The requirement to replace newlines does not match your sample output. To replace newlines with ,, you can do tr \\n ,, but this gives you output with a trailing comma that does not have a trailing newline. Also, it does not quote your input. Perhaps you are looking for:

paste -s -d, input

Or, if you do actually want the fields to be quoted:

< input sed "s/^\|$/'/g" | paste -s -d,

In the above, your input file is named input. The final command can also be written: